Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ac953d

Browse files
authored
Update docstring of locator_params() (#14019)
Update docstring of locator_params()
2 parents b097f85 + 0dc3fd8 commit 0ac953d

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,33 +2859,36 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
28592859

28602860
def locator_params(self, axis='both', tight=None, **kwargs):
28612861
"""
2862-
Control behavior of tick locators.
2862+
Control behavior of major tick locators.
2863+
2864+
Because the locator is involved in autoscaling, `~.Axes.autoscale_view`
2865+
is called automatically after the parameters are changed.
28632866
28642867
Parameters
28652868
----------
28662869
axis : {'both', 'x', 'y'}, optional
28672870
The axis on which to operate.
28682871
28692872
tight : bool or None, optional
2870-
Parameter passed to :meth:`autoscale_view`.
2873+
Parameter passed to `~.Axes.autoscale_view`.
28712874
Default is None, for no change.
28722875
28732876
Other Parameters
28742877
----------------
2875-
**kw
2878+
**kwargs
28762879
Remaining keyword arguments are passed to directly to the
2877-
:meth:`~matplotlib.ticker.MaxNLocator.set_params` method.
2880+
``set_params()`` method of the locator. Supported keywords depend
2881+
on the type of the locator. See for example
2882+
`~.ticker.MaxNLocator.set_params` for the `.ticker.MaxNLocator`
2883+
used by default for linear axes.
28782884
2879-
Typically one might want to reduce the maximum number of ticks and use
2880-
tight bounds when plotting small subplots, for example::
2885+
Examples
2886+
--------
2887+
When plotting small subplots, one might want to reduce the maximum
2888+
number of ticks and use tight bounds, for example::
28812889
28822890
ax.locator_params(tight=True, nbins=4)
28832891
2884-
Because the locator is involved in autoscaling, :meth:`autoscale_view`
2885-
is called automatically after the parameters are changed.
2886-
2887-
This presently works only for the `~matplotlib.ticker.MaxNLocator` used
2888-
by default on linear axes, but it may be generalized.
28892892
"""
28902893
_x = axis in ['x', 'both']
28912894
_y = axis in ['y', 'both']

0 commit comments

Comments
 (0)