Reputation: 399
I have data stored in a 1000x1000 matrix that I plot using plt.imshow(), resulting in the following image:
However, the y-axis are supposed to range from 0 to 300 and the x-axis from 0 to 1. I've tried using 'extent=[0,1,0,300]', but this results in the following:
I am wondering how I can adjust the values on the axes while retaining the 1:1 aspect-ratio (this is to create a Hovmöller plot, so the y-axis is unrelated to space).
plt.figure(1)
plt.imshow(phi.T, extent=[0,1,0,300], origin='lower')
cbar = plt.colorbar()
plt.show()
Upvotes: 0
Views: 1362