matplotlib.pyplot.thetagrids

matplotlib.pyplot.thetagrids(angles=None, labels=None, fmt=None, **kwargs)[源代码]

获取或设置当前极坐标图上的theta网格线。

呼叫签名:

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

在没有参数的情况下调用时, thetagrids 只返回元组( 线标签 )当使用参数调用时,标签将以指定的角度显示。

参数:
angles带浮点数的元组,度数

θ网格线的角度。

labels带字符串或无字符串的元组

用于每个径向网格线的标签。这个 projections.polar.ThetaFormatter 如果没有,将使用。

fmtSTR或无

中使用的格式字符串 matplotlib.ticker.FormatStrFormatter . 例如“%f”。请注意,将使用以弧度表示的角度。

返回:
线 名单 lines.Line2D名单

θ网格线。

标签 名单 text.Text名单

勾选标签。

其他参数:
**kwargs

关键字参数 是可选的 Text 标签的属性。

实例

# 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'))

使用实例 matplotlib.pyplot.thetagrids