On this page
matplotlib.axis.Axis.set_ticklabels
- Axis.set_ticklabels(ticklabels, *, minor=False, **kwargs)[source]
-
Set the text values of the tick labels.
Discouraged
The use of this method is discouraged, because of the dependency on tick positions. In most cases, you'll want to use
set_[x/y]ticks(positions, labels)instead.If you are using this method, you should always fix the tick positions before, e.g. by using
Axis.set_ticksor by explicitly setting aFixedLocator. Otherwise, ticks are free to move and the labels may end up in unexpected positions.- Parameters
-
- ticklabelssequence of str or of
Texts -
Texts for labeling each tick location in the sequence set by
Axis.set_ticks; the number of labels must match the number of locations. - minorbool
-
If True, set minor ticks instead of major ticks.
- **kwargs
-
Text properties.
- ticklabelssequence of str or of
- Returns
-
-
list of
Texts -
For each tick, includes
tick.label1if it is visible, thentick.label2if it is visible, in that order.
-
list of
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axis.Axis.set_ticklabels.html