python使用plt.imshow在座標軸上展示圖片,座標設定問題。
阿新 • • 發佈:2019-01-05
座標預設是從上到下,從左到右,例如
:
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’
,就得到如下圖: