The topic is not new but up till now all the examples i saw are used for random data and it somehow works with ax.img
. However, i couldnt manage to make my code work. I have tried this solution with ImageGrid
but i'm not sure how to defined my grid[0]
and grid[1]
(colorbar changes the size of subplot in python). I thought it supposed to be my first and second contour plot but it is not ... Below is a snippet of it.
X,Y = np.meshgrid(x,y)
fig = plt.figure()
ax1 = fig.add_subplot(121, aspect='equal')
ax2 = fig.add_subplot(122, aspect='equal')
ax1.contourf(X,Y,z1,100,cmap='RdGy') #100 equally spaced intervals within the data range
axs=ax2.contourf(X,Y,z1_90,100,cmap='RdGy')
ax2.set_yticklabels([])
ax1.set_ylabel('Bond length $H_{2}$-$H_{3}$ ($\AA$)')
fig.text(0.5, 0.135, 'Bond length $H_{2}$-$H_{1}$ ($\AA$)', ha='center')
cbar=plt.colorbar(axs,fraction=0.046, pad=0.04,label='E(Hartree)')
plt.tight_layout()
It would be great if you can give me hints how to solve the problem instead of pasting links because I have already googled a lot. As said above, the main problem here is that i have a contourf
plot and not some random data ...