Invert an axis in a matplotlib grafic

后端 未结 1 1477
抹茶落季
抹茶落季 2020-12-06 04:11

How can I invert the y_axis? Z is a np.array.Thank you

Z=TempLake 

X,Y=np.meshgrid(range(Z.shape[0]+1),range(Z.shape[1]+1)) 
im = plt.pcolormesh(X,Y,Z.trans         


        
相关标签:
1条回答
  • 2020-12-06 04:47

    As @Chris said, this can be done with:

    ax = plt.gca()
    ax.invert_yaxis()
    

    Before the 'plt.show()'.

    0 讨论(0)
提交回复
热议问题