You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Applications are open for the 2018 John Hunter Matplotlib Summer Fellowship. Apply now!
Version 2.2.2.post1722+g3b337c9d6
Fork me on GitHub


matplotlib.pyplot.thetagrids(*args, **kwargs)[source]

Get or set the theta gridlines on the current polar plot.

Call signatures:

lines, labels = thetagrids()
lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs)

When called with no arguments, thetagrids simply returns the tuple (lines, labels). When called with arguments, the labels will appear at the specified angles.

angles : tuple with floats, degrees

The angles of the theta gridlines.

labels : tuple with strings or None

The labels to use at each radial gridline. The projections.polar.ThetaFormatter will be used if None.

fmt : str or None

Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'. Note that the angle in radians will be used.

lines, labels : list of lines.Line2D, list of text.Text

lines are the theta gridlines and labels are the tick labels.

Other Parameters:

kwargs are optional Text properties for the labels.


# set the locations of the angular gridlines
lines, labels = thetagrids( range(45,360,90) )

# set the locations and labels of the angular gridlines
lines, labels = thetagrids( range(45,360,90), ('NE', 'NW', 'SW','SE') )