Set the xaxis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
List of tick locations.
List of tick labels. If not set, the labels show the data value.
If False
, set the major ticks; if True
, the minor ticks.
Text
properties for the labels. These take effect only if you pass labels. In other cases, please use tick_params
.
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
matplotlib.axes.Axes.set_xticks
© 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.set_xticks.html