Control behavior of major tick locators.
Because the locator is involved in autoscaling, autoscale_view
is called automatically after the parameters are changed.
The axis on which to operate.
Parameter passed to autoscale_view
. Default is None, for no change.
Remaining keyword arguments are passed to directly to the set_params()
method of the locator. Supported keywords depend on the type of the locator. See for example set_params
for the ticker.MaxNLocator
used by default for linear axes.
When plotting small subplots, one might want to reduce the maximum number of ticks and use tight bounds, for example:
ax.locator_params(tight=True, nbins=4)
matplotlib.axes.Axes.locator_params
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axes.Axes.locator_params.html