简体   繁体   English

在matplotlib中使用rcparams设置主要和次要定位器

[英]using rcparams in matplotlib to set major and minor locators

from matplotlib.dates import DateFormatter, YearLocator, MonthLocator
ax.xaxis.set_major_locator(YearLocator())
ax.xaxis.set_minor_locator(MonthLocator(bymonthday=1, interval=2))

Is it possible to set the code above using matplotlib rcparams? 是否可以使用matplotlib rcparams设置上面的代码?

No. You cannot control the locator via matplotlib rc. 不能。您无法通过matplotlib rc控制定位器。 The default is always an AutoDateLocator . 默认值始终是AutoDateLocator

All valid matplotlib rc parameter are shown in the example file https://matplotlib.org/users/customizing.html . 示例文件https://matplotlib.org/users/customizing.html中显示了所有有效的matplotlib rc参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM