matplotlib.axes.Axes.set_yticks#
- Axes.set_yticks(ticks, labels=None, *, minor=False, **kwargs)[source]#
Set the yaxis' tick locations and optionally labels.
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. The axis
Locator
is replaced by aFixedLocator
.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.- labelslist of str, optional
List of tick labels. If not set, the labels are generated with the axis tick
Formatter
.- minorbool, default: False
If
False
, set the major ticks; ifTrue
, the minor ticks.- **kwargs
Text
properties for the labels. These take effect only if you pass labels. In other cases, please usetick_params
.
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.axes.Axes.set_yticks
#
Rendering math equations using TeX
Programmatically controlling subplot adjustment
Make room for ylabel using axes_grid
Scatter Histogram (Locatable Axes)
Integral as the area under a curve
Shaded & power normalized rendering
Create 2D bar graphs in different planes
SkewT-logP diagram: using transforms and custom projections