You are reading an old version of the documentation (v2.2.0). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.yticks.html
Version 2.2.0
matplotlib
Fork me on GitHub

Table Of Contents

This Page

matplotlib.pyplot.yticks

matplotlib.pyplot.yticks(*args, **kwargs)

Get or set the y-limits of the current tick locations and labels.

# return locs, labels where locs is an array of tick locations and
# labels is an array of tick labels.
locs, labels = yticks()

# set the locations of the yticks
yticks( arange(6) )

# set the locations and labels of the yticks
yticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )

The keyword args, if any, are Text properties. For example, to rotate long labels:

yticks( arange(12), calendar.month_name[1:13], rotation=45 )