本文簡要介紹 python 語言中 matplotlib.pyplot.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)
用法
matplotlib.pyplot.locator_params(axis='both', tight=None, **kwargs)
相關用法
- Python matplotlib loglog用法及代碼示例
- Python matplotlib legend用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib MovieWriterRegistry.register用法及代碼示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代碼示例
- Python matplotlib warn_deprecated用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.locator_params。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。