title: Adjust size of 2 contour maps to height of color bar
body: <p>The topic is not new but up till now all the examples i saw are used for random data and it somehow works with <code>ax.img</code>. However, i couldnt manage to make my code work. I have tried this solution with <code>ImageGrid</code> but i'm not sure how to defined my <code>grid[0]</code> and <code>grid[1]</code> (<a href="https://stackoverflow.com/questions/60428817/colorbar-changes-the-size-of-subplot-in-python">colorbar changes the size of subplot in python</a>). I thought it supposed to be my first and second contour plot but it is not ... Below is a snippet of it.</p>
  <pre><code>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()
  </code></pre>
  <p>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 <code>contourf</code> plot and not some random data ...
  <a href="https://i.stack.imgur.com/znXG4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/znXG4.png" alt="enter image description here" /></a></p>