當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python matplotlib rgrids用法及代碼示例

本文簡要介紹 python 語言中 matplotlib.pyplot.rgrids 的用法。

用法

matplotlib.pyplot.rgrids(radii=None, labels=None, angle=None, fmt=None, **kwargs)

獲取或設置當前極坐標圖上的徑向網格線。

調用簽名:

lines, labels = rgrids()
lines, labels = rgrids(radii, labels=None, angle=22.5, fmt=None, **kwargs)

當不帶參數調用時, rgrids 僅返回元組( lineslabels )。當使用參數調用時,標簽將出現在指定的徑向距離和角度處。

參數
radii 帶浮點數的元組

徑向網格線的半徑

labels 帶字符串或無的元組

在每個徑向網格線上使用的標簽。如果沒有,將使用 matplotlib.ticker.ScalarFormatter

angle 浮點數

半徑標簽的角度位置,以度為單位。

fmt str 或 None

matplotlib.ticker.FormatStrFormatter 中使用的格式字符串。例如'%f'。

返回
lines lines.Line2D 列表

徑向網格線。

labels text.Text 列表

刻度標簽。

其他參數
**kwargs

kwargs 是標簽的可選 Text 屬性。

例子

# set the locations of the radial gridlines
lines, labels = rgrids( (0.25, 0.5, 1.0) )

# set the locations and labels of the radial gridlines
lines, labels = rgrids( (0.25, 0.5, 1.0), ('Tom', 'Dick', 'Harry' ))

相關用法


注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.rgrids。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。