You are reading an old version of the documentation (v2.2.0). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.locator_params.html
Version 2.2.0
matplotlib
Fork me on GitHub

This Page

matplotlib.axes.Axes.locator_params

Axes.locator_params(axis='both', tight=None, **kwargs)

Control behavior of tick locators.

Parameters:

axis : [‘both’ | ‘x’ | ‘y’], optional

The axis on which to operate.

tight : bool or None, optional

Parameter passed to autoscale_view(). Default is None, for no change.

Other Parameters:
 

**kw :

Remaining keyword arguments are passed to directly to the set_params() method.

Typically one might want to reduce the maximum number

of ticks and use tight bounds when plotting small

subplots, for example::

ax.locator_params(tight=True, nbins=4)

Because the locator is involved in autoscaling,

:meth:`autoscale_view` is called automatically after

the parameters are changed.

This presently works only for the

:class:`~matplotlib.ticker.MaxNLocator` used

by default on linear axes, but it may be generalized.