本文簡要介紹 python 語言中 matplotlib.axes.Axes.locator_params
的用法。
-
控製主要刻度定位器的行為。
因為定位器參與了自動縮放,所以參數改變後會自動調用
autoscale_view
。- 參數:
- axis {'both', 'x', 'y'},默認:'both'
-
要操作的軸。 (對於 3D 軸,
axis
也可以設置為 'z','both' 指所有三個軸。) - tight 布爾或無,可選
-
傳遞給
autoscale_view
的參數。默認為無,無變化。
- 其他參數:
- **kwargs
-
其餘關鍵字參數直接傳遞給定位器的
set_params()
方法。支持的關鍵字取決於定位器的類型。例如,請參閱set_params
,了解默認用於線性的ticker.MaxNLocator
。
例子
繪製小子圖時,可能希望減少最大刻度數並使用嚴格的界限,例如:
ax.locator_params(tight=True, nbins=4)
用法
Axes.locator_params(axis='both', tight=None, **kwargs)
相關用法
- Python matplotlib Axes.loglog用法及代碼示例
- Python matplotlib Axes.legend用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib Axes.inset_axes用法及代碼示例
- Python matplotlib Axes.axis用法及代碼示例
- Python matplotlib Axes.barbs用法及代碼示例
- Python matplotlib Axes.tripcolor用法及代碼示例
- Python matplotlib Axes.set_prop_cycle用法及代碼示例
- Python matplotlib Axes.axline用法及代碼示例
- Python matplotlib Axes.tick_params用法及代碼示例
- Python matplotlib Axes.axvspan用法及代碼示例
- Python matplotlib Axes.contourf用法及代碼示例
- Python matplotlib Axes.tricontourf用法及代碼示例
- Python matplotlib Axes.set_ylim用法及代碼示例
- Python matplotlib Axes.text用法及代碼示例
- Python matplotlib Axes.boxplot用法及代碼示例
- Python matplotlib Axes.triplot用法及代碼示例
- Python matplotlib Axes.tricontour用法及代碼示例
- Python matplotlib Axes.arrow用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.axes.Axes.locator_params。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。