matplotlib.pyplot.thetagrids#

matplotlib.pyplot.thetagrids(angles=None,labels=None,fmt=None,**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 willappear at the specified angles.

Parameters:
anglestuple with floats, degrees

The angles of the theta gridlines.

labelstuple with strings or None

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

fmtstr or None

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

Returns:
lineslist oflines.Line2D

The theta gridlines.

labelslist oftext.Text

The tick labels.

Other Parameters:
**kwargs

kwargs are optionalText properties for the labels.

Examples

# set the locations of the angular gridlineslines,labels=thetagrids(range(45,360,90))# set the locations and labels of the angular gridlineslines,labels=thetagrids(range(45,360,90),('NE','NW','SW','SE'))
On this page