matplotlib X轴日期倾斜位置调整(双Y轴)

如果使用了to_datetime方法设置labels日期会自动倾斜。

双Y轴时,xtick设置rotation是不起作用的。

需要使用autofmt_xdate方法。

例子

fig X轴坐标为正且居中。

fig.autofmt_xdate(rotation=0,ha='center')

posted @ 2021-11-16 11:30  羊望星空  阅读(771)  评论(0)    收藏  举报