matplotlib.axes.Axes.locator_params
-
Axes.locator_params(axis='both', tight=None, **kwargs)
-
Control behavior of tick locators.
Keyword arguments:
- axis
- [‘x’ | ‘y’ | ‘both’] Axis on which to operate; default is ‘both’.
- tight
- [True | False | None] Parameter passed to
autoscale_view()
. Default is None, for no change.
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,
autoscale_view()
is called automatically after the parameters are changed.This presently works only for the
MaxNLocator
used by default on linear axes, but it may be generalized.
© 2012–2017 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
http://matplotlib.org/2.0.2/api/_as_gen/matplotlib.axes.Axes.locator_params.html