本文简要介绍 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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。