没有水平对齐的matplotlib月轴

matplotlib month axis without horizontal align

当我使用 matplotlib 库在 x 轴上绘制带有月份的数据时,我遇到了这个问题

月份没有水平对齐,就像那样

sep           nov
       oct           dic

这样轴真的很难看

我该如何解决这个问题?

编辑

如果我使用 baseline

for tick in ax.xaxis.iter_ticks():
    tick[0].label1.set_verticalalignment('baseline')

我明白了

这应该是 an issue that has been fixed 和更新版本 matplotlib --- 确保您使用的是更新版本。

对于仍然是的问题的任何人来说,它could be a problem with your backend