Skip to content

Expanded documentation of Axis.set_ticks as per discussion in issue #22262 #22270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 22, 2022
Merged
12 changes: 10 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,9 +1823,17 @@ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
Parameters
----------
ticks : list of floats
List of tick locations.
List of tick locations. The axis `.Locator` is replaced by a
`~.ticker.FixedLocator`.

Some tick formatters will not label arbitrary tick positions;
e.g. log formatters only label decade ticks by default. In
such a case you can set a formatter explicitly on the axis
using `.Axis.set_major_formatter` or provide formatted
*labels* yourself.
labels : list of str, optional
List of tick labels. If not set, the labels show the data value.
List of tick labels. If not set, the labels are generated with
the axis tick `.Formatter`.
minor : bool, default: False
If ``False``, set the major ticks; if ``True``, the minor ticks.
**kwargs
Expand Down