【发布时间】:2012-03-06 10:30:02
【问题描述】:
我有时间序列图(超过 1 年),其中 x 轴上的月份形式为 Jan、Feb、Mar 等,但我希望只使用月份的第一个字母(J ,F,M 等)。我使用
设置刻度线ax.xaxis.set_major_locator(MonthLocator())
ax.xaxis.set_minor_locator(MonthLocator())
ax.xaxis.set_major_formatter(matplotlib.ticker.NullFormatter())
ax.xaxis.set_minor_formatter(matplotlib.dates.DateFormatter('%b'))
任何帮助将不胜感激。
【问题讨论】:
标签: python matplotlib