matplotlib画条形图的时候,x坐标轴标签默认是垂直的,这样看起来比较费力,如下图:

matplotlib画图,x轴标签旋转

调整x轴标签,从垂直变成水平或者任何你想要的角度,只需要改变rotation的数值。

for tick in ax1.get_xticklabels():

    tick.set_rotation(360)

或者

import pylab as pl

pl.xticks(rotation=360)

matplotlib画图,x轴标签旋转

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-11-08
相关资源
相似解决方案