I would like to plot 2 subplots in the same row with the same aspect ratio. It's quite ugly otherwise !
So, usually, I'm using axes().set_aspect('equal')
(because I want ALSO to remove the axis, and I can't use 'off' AND 'equal') from pylab but it doesn't work right here, only the 2nd picture appears
My code:
plt.subplot(1,2,1)
axes().set_aspect('equal')
plt.tricontourf(x_exp, y_exp, z_exp)
plt.colorbar(shrink=0.9,drawedges=True, orientation='vertical')
plt.axis('off')
plt.title('tricontour')
plt.subplot(1,2,2)
axes().set_aspect('equal')
plt.tricontourf(x_exp, y_exp, z_exp2)
plt.colorbar(shrink=0.9,drawedges=True, orientation='vertical')
plt.axis('off')
plt.title('tricontour')
plt.show()
It could probably work with the following line but subplot doesn't have the tricontourf
plot !
fig = plt.figure()
ax1 = fig.add_subplot(2,1,1, adjustable='box', aspect=0.3)
ax2 = fig.add_subplot(2,1,2)
Do you have an idea to figure out that ?
EDIT: Sample of data
I have used np.savez("Sample",x_exp=x_exp,y_exp=y_exp,z_exp=z_exp,z_exp2=z_exp2)
to save the data.
You can read it with the following lines:
import numpy as np
Data = np.load("Sample.npz")
x_exp = Data['x_exp']
y_exp = Data['y_exp']
z_exp = Data['z_exp']
z_exp2 = Data['z_exp2']
x_exp
,y_exp
,z_exp
andz_exp2
? – Julien Spronck