@@ -1589,7 +1589,7 @@ def symbol(self, symbol):
1589
1589
1590
1590
class Locator (TickHelper ):
1591
1591
"""
1592
- Determine the tick locations;
1592
+ Determine tick locations.
1593
1593
1594
1594
Note that the same locator should not be used across multiple
1595
1595
`~matplotlib.axis.Axis` because the locator stores references to the Axis
@@ -1679,10 +1679,10 @@ def view_limits(self, vmin, vmax):
1679
1679
1680
1680
class IndexLocator (Locator ):
1681
1681
"""
1682
- Place a tick on every multiple of some base number of points
1683
- plotted, e.g., on every 5th point. It is assumed that you are doing
1684
- index plotting; i.e., the axis is 0, len(data). This is mainly
1685
- useful for x ticks .
1682
+ Place ticks at every nth point plotted.
1683
+
1684
+ IndexLocator assumes index plotting; i.e., that the ticks are placed at integer
1685
+ values in the range between 0 and len(data) inclusive .
1686
1686
"""
1687
1687
def __init__ (self , base , offset ):
1688
1688
"""Place ticks every *base* data point, starting at *offset*."""
@@ -1708,12 +1708,12 @@ def tick_values(self, vmin, vmax):
1708
1708
1709
1709
class FixedLocator (Locator ):
1710
1710
"""
1711
- Tick locations are fixed at *locs*. If *nbins* is not None,
1712
- the *locs* array of possible positions will be subsampled to
1713
- keep the number of ticks <= *nbins* +1.
1714
- The subsampling will be done to include the smallest
1715
- absolute value; for example, if zero is included in the
1716
- array of possibilities, then it is guaranteed to be one of
1711
+ Place ticks at a set of fixed values.
1712
+
1713
+ If *nbins* is None ticks are placed at all values. Otherwise, the *locs* array of
1714
+ possible positions will be subsampled to keep the number of ticks <=
1715
+ :math:`nbins* +1`. The subsampling will be done to include the smallest absolute
1716
+ value; for example, if zero is included in the array of possibilities, then it of
1717
1717
the chosen ticks.
1718
1718
"""
1719
1719
@@ -1773,7 +1773,7 @@ def tick_values(self, vmin, vmax):
1773
1773
1774
1774
class LinearLocator (Locator ):
1775
1775
"""
1776
- Determine the tick locations
1776
+ Place ticks at evenly spaced values.
1777
1777
1778
1778
The first time this function is called it will try to set the
1779
1779
number of ticks to make a nice tick partitioning. Thereafter, the
@@ -1854,8 +1854,7 @@ def view_limits(self, vmin, vmax):
1854
1854
1855
1855
class MultipleLocator (Locator ):
1856
1856
"""
1857
- Set a tick on each integer multiple of the *base* plus an *offset* within
1858
- the view interval.
1857
+ Place ticks at every integer multiple of a base plus an offset.
1859
1858
"""
1860
1859
1861
1860
def __init__ (self , base = 1.0 , offset = 0.0 ):
@@ -1983,7 +1982,9 @@ def ge(self, x):
1983
1982
1984
1983
class MaxNLocator (Locator ):
1985
1984
"""
1986
- Find nice tick locations with no more than *nbins* + 1 being within the
1985
+ Place evenly spaced ticks, with a cap on the total number of ticks.
1986
+
1987
+ Finds nice tick locations with no more than :math:`nbins + 1` ticks being within the
1987
1988
view limits. Locations beyond the limits are added to support autoscaling.
1988
1989
"""
1989
1990
default_params = dict (nbins = 10 ,
@@ -2266,38 +2267,34 @@ def _is_close_to_int(x):
2266
2267
2267
2268
class LogLocator (Locator ):
2268
2269
"""
2270
+ Place logarithmically spaced ticks.
2269
2271
2270
- Determine the tick locations for log axes.
2271
-
2272
- Place ticks on the locations : ``subs[j] * base**i``
2273
-
2274
- Parameters
2275
- ----------
2276
- base : float, default: 10.0
2277
- The base of the log used, so major ticks are placed at
2278
- ``base**n``, where ``n`` is an integer.
2279
- subs : None or {'auto', 'all'} or sequence of float, default: (1.0,)
2280
- Gives the multiples of integer powers of the base at which
2281
- to place ticks. The default of ``(1.0, )`` places ticks only at
2282
- integer powers of the base.
2283
- Permitted string values are ``'auto'`` and ``'all'``.
2284
- Both of these use an algorithm based on the axis view
2285
- limits to determine whether and how to put ticks between
2286
- integer powers of the base. With ``'auto'``, ticks are
2287
- placed only between integer powers; with ``'all'``, the
2288
- integer powers are included. A value of None is
2289
- equivalent to ``'auto'``.
2290
- numticks : None or int, default: None
2291
- The maximum number of ticks to allow on a given axis. The default
2292
- of ``None`` will try to choose intelligently as long as this
2293
- Locator has already been assigned to an axis using
2294
- `~.axis.Axis.get_tick_space`, but otherwise falls back to 9.
2295
-
2272
+ Places ticks at the values ``subs[j] * base**i``.
2296
2273
"""
2297
2274
2298
2275
@_api .delete_parameter ("3.8" , "numdecs" )
2299
2276
def __init__ (self , base = 10.0 , subs = (1.0 ,), numdecs = 4 , numticks = None ):
2300
- """Place ticks on the locations : subs[j] * base**i."""
2277
+ """
2278
+ Parameters
2279
+ ----------
2280
+ base : float, default: 10.0
2281
+ The base of the log used, so major ticks are placed at ``base**n``, where
2282
+ ``n`` is an integer.
2283
+ subs : None or {'auto', 'all'} or sequence of float, default: (1.0,)
2284
+ Gives the multiples of integer powers of the base at which to place ticks.
2285
+ The default of ``(1.0, )`` places ticks only at integer powers of the base.
2286
+ Permitted string values are ``'auto'`` and ``'all'``. Both of these use an
2287
+ algorithm based on the axis view limits to determine whether and how to put
2288
+ ticks between integer powers of the base:
2289
+ - ``'auto'``: Ticks are placed only between integer powers.
2290
+ - ``'all'``: Ticks are placed between *and* at integer powers.
2291
+ - ``None``: Equivalent to ``'auto'``.
2292
+ numticks : None or int, default: None
2293
+ The maximum number of ticks to allow on a given axis. The default of
2294
+ ``None`` will try to choose intelligently as long as this Locator has
2295
+ already been assigned to an axis using `~.axis.Axis.get_tick_space`, but
2296
+ otherwise falls back to 9.
2297
+ """
2301
2298
if numticks is None :
2302
2299
if mpl .rcParams ['_internal.classic_mode' ]:
2303
2300
numticks = 15
@@ -2464,7 +2461,7 @@ def nonsingular(self, vmin, vmax):
2464
2461
2465
2462
class SymmetricalLogLocator (Locator ):
2466
2463
"""
2467
- Determine the tick locations for symmetric log axes .
2464
+ Place ticks spaced linearly near zero and spaced logarithmically beyond a threshold .
2468
2465
"""
2469
2466
2470
2467
def __init__ (self , transform = None , subs = None , linthresh = None , base = None ):
@@ -2618,10 +2615,9 @@ def view_limits(self, vmin, vmax):
2618
2615
2619
2616
class AsinhLocator (Locator ):
2620
2617
"""
2621
- An axis tick locator specialized for the inverse-sinh scale
2618
+ Place ticks spaced evenly on an inverse-sinh scale.
2622
2619
2623
- This is very unlikely to have any use beyond
2624
- the `~.scale.AsinhScale` class.
2620
+ Generally used with the `~.scale.AsinhScale` class.
2625
2621
2626
2622
.. note::
2627
2623
@@ -2711,13 +2707,11 @@ def tick_values(self, vmin, vmax):
2711
2707
2712
2708
class LogitLocator (MaxNLocator ):
2713
2709
"""
2714
- Determine the tick locations for logit axes
2710
+ Place ticks spaced evenly on a logit scale.
2715
2711
"""
2716
2712
2717
2713
def __init__ (self , minor = False , * , nbins = "auto" ):
2718
2714
"""
2719
- Place ticks on the logit locations
2720
-
2721
2715
Parameters
2722
2716
----------
2723
2717
nbins : int or 'auto', optional
@@ -2859,9 +2853,11 @@ def nonsingular(self, vmin, vmax):
2859
2853
2860
2854
class AutoLocator (MaxNLocator ):
2861
2855
"""
2862
- Dynamically find major tick positions. This is actually a subclass
2863
- of `~matplotlib.ticker.MaxNLocator`, with parameters *nbins = 'auto'*
2864
- and *steps = [1, 2, 2.5, 5, 10]*.
2856
+ Place evenly spaced ticks, with the step size and maximum number of ticks chosen
2857
+ automatically.
2858
+
2859
+ This is a subclass of `~matplotlib.ticker.MaxNLocator`, with parameters
2860
+ *nbins = 'auto'* and *steps = [1, 2, 2.5, 5, 10]*.
2865
2861
"""
2866
2862
def __init__ (self ):
2867
2863
"""
@@ -2879,8 +2875,10 @@ def __init__(self):
2879
2875
2880
2876
class AutoMinorLocator (Locator ):
2881
2877
"""
2882
- Dynamically find minor tick positions based on the positions of
2883
- major ticks. The scale must be linear with major ticks evenly spaced.
2878
+ Place evenly spaced minor ticks, with the step size and maximum number of ticks
2879
+ chosen automatically.
2880
+
2881
+ The Axis scale must be linear with evenly spaced major ticks .
2884
2882
"""
2885
2883
2886
2884
def __init__ (self , n = None ):
0 commit comments