diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 9165917bfc7e..fda85782689a 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -2255,35 +2255,37 @@ def _is_close_to_int(x): class LogLocator(Locator): """ - Determine the tick locations for log axes + + Determine the tick locations for log axes. + + Place ticks on the locations : ``subs[j] * base**i`` + + Parameters + ---------- + base : float, default: 10.0 + The base of the log used, so major ticks are placed at + ``base**n``, where ``n`` is an integer. + subs : None or {'auto', 'all'} or sequence of float, default: (1.0,) + Gives the multiples of integer powers of the base at which + to place ticks. The default of ``(1.0, )`` places ticks only at + integer powers of the base. + Permitted string values are ``'auto'`` and ``'all'``. + Both of these use an algorithm based on the axis view + limits to determine whether and how to put ticks between + integer powers of the base. With ``'auto'``, ticks are + placed only between integer powers; with ``'all'``, the + integer powers are included. A value of None is + equivalent to ``'auto'``. + numticks : None or int, default: None + The maximum number of ticks to allow on a given axis. The default + of ``None`` will try to choose intelligently as long as this + Locator has already been assigned to an axis using + `~.axis.Axis.get_tick_space`, but otherwise falls back to 9. + """ def __init__(self, base=10.0, subs=(1.0,), numdecs=4, numticks=None): - """ - Place ticks at values ``subs[j] * base**n``. - - Parameters - ---------- - base : float, default: 10.0 - The base of the log used, so major ticks are placed at - ``base**n``, where ``n`` is an integer. - subs : None or {'auto', 'all'} or sequence of float, default: (1.0,) - Gives the multiples of integer powers of the base at which - to place ticks. The default of ``(1.0, )`` places ticks only at - integer powers of the base. - Permitted string values are ``'auto'`` and ``'all'``. - Both of these use an algorithm based on the axis view - limits to determine whether and how to put ticks between - integer powers of the base. With ``'auto'``, ticks are - placed only between integer powers; with ``'all'``, the - integer powers are included. A value of None is - equivalent to ``'auto'``. - numticks : None or int, default: None - The maximum number of ticks to allow on a given axis. The default - of ``None`` will try to choose intelligently as long as this - Locator has already been assigned to an axis using - `~.axis.Axis.get_tick_space`, but otherwise falls back to 9. - """ + """Place ticks on the locations : subs[j] * base**i.""" if numticks is None: if mpl.rcParams['_internal.classic_mode']: numticks = 15