matplotlib.axis.Axis.set_ticks

Axis.set_ticks(ticks, *, minor=False)[source]

Set this Axis' tick locations.

If necessary, the view limits of the Axis are expanded so that all given ticks are visible.

Parameters:
tickslist of floats

List of tick locations.

minorbool, default: False

If False, set the major ticks; if True, the minor ticks.

Notes

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.

Examples using matplotlib.axis.Axis.set_ticks