@@ -1707,10 +1707,10 @@ def tick_values(self, vmin, vmax):
1707
1707
1708
1708
class FixedLocator (Locator ):
1709
1709
"""
1710
- Tick locations are fixed. If nbins is not None,
1711
- the array of possible positions will be subsampled to
1712
- keep the number of ticks <= nbins +1.
1713
- The subsampling will be done so as to include the smallest
1710
+ Tick locations are fixed at *locs* . If * nbins* is not None,
1711
+ the *locs* array of possible positions will be subsampled to
1712
+ keep the number of ticks <= * nbins* +1.
1713
+ The subsampling will be done to include the smallest
1714
1714
absolute value; for example, if zero is included in the
1715
1715
array of possibilities, then it is guaranteed to be one of
1716
1716
the chosen ticks.
@@ -1774,14 +1774,21 @@ class LinearLocator(Locator):
1774
1774
Determine the tick locations
1775
1775
1776
1776
The first time this function is called it will try to set the
1777
- number of ticks to make a nice tick partitioning. Thereafter the
1777
+ number of ticks to make a nice tick partitioning. Thereafter, the
1778
1778
number of ticks will be fixed so that interactive navigation will
1779
1779
be nice
1780
1780
1781
1781
"""
1782
1782
def __init__ (self , numticks = None , presets = None ):
1783
1783
"""
1784
- Use presets to set locs based on lom. A dict mapping vmin, vmax->locs
1784
+ Parameters
1785
+ ----------
1786
+ numticks : int or None, default None
1787
+ Number of ticks. If None, *numticks* = 11.
1788
+ presets : dict or None, default: None
1789
+ Dictionary mapping ``(vmin, vmax)`` to an array of locations.
1790
+ Overrides *numticks* if there is an entry for the current
1791
+ ``(vmin, vmax)``.
1785
1792
"""
1786
1793
self .numticks = numticks
1787
1794
if presets is None :
@@ -1847,7 +1854,8 @@ def view_limits(self, vmin, vmax):
1847
1854
1848
1855
class MultipleLocator (Locator ):
1849
1856
"""
1850
- Set a tick on each integer multiple of a base within the view interval.
1857
+ Set a tick on each integer multiple of the *base* within the view
1858
+ interval.
1851
1859
"""
1852
1860
1853
1861
def __init__ (self , base = 1.0 ):
@@ -1874,7 +1882,7 @@ def tick_values(self, vmin, vmax):
1874
1882
1875
1883
def view_limits (self , dmin , dmax ):
1876
1884
"""
1877
- Set the view limits to
8000
the nearest multiples of base that
1885
+ Set the view limits to the nearest multiples of * base* that
1878
1886
contain the data.
1879
1887
"""
1880
1888
if mpl .rcParams ['axes.autolimit_mode' ] == 'round_numbers' :
@@ -1903,16 +1911,20 @@ def scale_range(vmin, vmax, n=1, threshold=100):
1903
1911
1904
1912
class _Edge_integer :
1905
1913
"""
1906
- Helper for MaxNLocator, MultipleLocator, etc.
1914
+ Helper for `. MaxNLocator`, `. MultipleLocator` , etc.
1907
1915
1908
- Take floating point precision limitations into account when calculating
1916
+ Take floating- point precision limitations into account when calculating
1909
1917
tick locations as integer multiples of a step.
1910
1918
"""
1911
1919
def __init__ (self , step , offset ):
1912
1920
"""
1913
- *step* is a positive floating-point interval between ticks.
1914
- *offset* is the offset subtracted from the data limits
1915
- prior to calculating tick locations.
1921
+ Parameters
1922
+ ----------
1923
+ step : float > 0
1924
+ Interval between ticks.
1925
+ offset : float
1926
+ Offset subtracted from the data limits prior to calculating tick
1927
+ locations.
1916
1928
"""
1917
1929
if step <= 0 :
1918
1930
raise ValueError ("'step' must be positive" )
@@ -1946,8 +1958,8 @@ def ge(self, x):
1946
1958
1947
1959
class MaxNLocator (Locator ):
1948
1960
"""
1949
- Find nice tick locations with no more than N being within the view limits.
1950
- Locations beyond the limits are added to support autoscaling.
1961
+ Find nice tick locations with no more than *nbins* + 1 being within the
1962
+ view limits. Locations beyond the limits are added to support autoscaling.
1951
1963
"""
1952
1964
default_params = dict (nbins = 10 ,
1953
1965
steps = None ,
0 commit comments