python使用plt.imshow在坐标轴上展示图片,坐标设置问题。

xiaoxiao2021-02-28  39

坐标默认是从上到下,从左到右,例如 :

matplotlib.pyplot.imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None, vmin=None, vmax=None, origin=None, extent=None, shape=None, filternorm=1, filterrad=4.0, imlim=None, resample=None, url=None, hold=None, data=None, **kwargs

他的参数很多,找了很久,才发现,应该是设置origin参数。

origin : [‘upper’ | ‘lower’], optional, default: None Place the [0,0] index of the array in the upper left or lower left corner of the axes. If None, default to rc image.origin.

设origin=‘lower’,就得到如下图:

转载请注明原文地址: https://www.6miu.com/read-2626252.html

最新回复(0)