我正在尝试series
用'pandas.tseries.index.DatetimeIndex'
. x 轴标签顽固地重叠,即使有几个建议的解决方案,我也无法使它们呈现出来。
我尝试了 建议使用的 stackoverflow 解决方案,autofmt_xdate
但它没有帮助。
我也尝试了对 的建议plt.tight_layout()
,但没有产生效果。
ax = test_df[(test_df.index.year ==2017) ]['error'].plot(kind="bar")
ax.figure.autofmt_xdate()
#plt.tight_layout()
print(type(test_df[(test_df.index.year ==2017) ]['error'].index))
Run Code Online (Sandbox Code Playgroud)
更新:我使用条形图是一个问题。常规时间序列图显示管理良好的标签。