I'm trying to plot a soundfield both in matlab and python but if Matlab allows me to do like this:
imagesc(x,y,real(sf_vsrc)); colorbar; axis xy title('soundfield ground truth');
using python I'm doing like this:
plt.imshow(sf_vsrc_gt,extent=[x[0],x[-1],y[0],y[-1]]) plt.colorbar() plt.show()
Indeed, in Matlb if I don't put "axis xy" I have the same plot as python, so how can I put "axis xy" in python to have the same result as Matlab?
You can change it via an optional input:
plt.imshow(sf_vsrc_gt,extent=[x[0],x[-1],y[0],y[-1]], origin='lower')
or by later playing with the extent and origin properties.
extent
origin
2.1m questions
2.1m answers
60 comments
57.0k users