Matplotlib coord. sys origin to top left

前端 未结 5 678
栀梦
栀梦 2020-12-14 09:26

How can I flip the origin of a matplotlib plot to be in the upper-left corner - as opposed to the default lower-left? I\'m using matplotlib.pylab.plot to produce the plot (

5条回答
  •  情话喂你
    2020-12-14 10:02

    The easiest way is to use:

    plt.gca().invert_yaxis()
    

    After you plotted the image. Origin works only for imshow.

提交回复
热议问题