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
简单地返回元组(lines,labels)。当带参数调用时,标签将出现在指定的角度。- 参数:
- 角度包含浮点数的元组,度数
theta 网格线的角度。
- 标签包含字符串或 None 的元组
每个径向网格线使用的标签。如果为 None,将使用
projections.polar.ThetaFormatter
。- fmt字符串或无
在
matplotlib.ticker.FormatStrFormatter
中使用的格式字符串。例如 '%f'。注意,角度将以弧度为单位。
- 返回:
- lines :
lines.Line2D
的列表列表 theta 网格线。
- 标签 :
text.Text
的列表列表 刻度标签。
- lines :
- 其他参数:
- **kwargs
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'))