Rotation of colorbar tick labels in matplotlib

前端 未结 2 586
暖寄归人
暖寄归人 2021-01-19 01:23

I would like to rotate the colorbar tick labels so that they read vertically rather than horizontally. I have tried as many variations as I can think of with cbar.ax.s

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 01:49

    If you're happy with tick locations and labels and only want to rotate them:

    cbar.ax.set_xticklabels(cbar.ax.get_xticklabels(), rotation='vertical')
    

提交回复
热议问题