I have the following figure. Equal aspect ratio for each of the axes is a requirement. I'd love the widths to match between subplots and the height to be defined by the aspect ratio of the subplot.
I attempted using GridSpec- total mess- it's impossible to shrink the whitespace to make a reasonable plot, so I've got to be doing something wrong:
left = 0.125
right = 0.9
bottom = 0.2
top = 0.9
wspace = 0.1
hspace = 0.1
fig = plt.figure(5, figsize=(4, 12))
gs = gridspec.GridSpec(5, 1,
width_ratios=[1,1,1,1,1],
height_ratios=[0.5,1.2,1,1.5,3])
plt.subplots_adjust(left=left,right=right,wspace=wspace,bottom=bottom,top=top,hspace=hspace)
ax1 = plt.subplot(gs[0],aspect='equal',xlim=[0,2],ylim=[0,0.5])
plt.plot(z,z,color='black',zorder=1)
ax1.grid(which='major', alpha=0.5)
sc = plt.scatter(bob1[:-1,4],bob1[:-1,2],cmap=cmap,c=z,s=45,zorder=2)
ax2 = plt.subplot(gs[1],aspect='equal',xlim=[0,1.5],ylim=[0,0.8])
plt.plot(z,z,color='black',zorder=1)
ax2.grid(which='major', alpha=0.5)
major_ticks = np.arange(0, 1.4, 0.4)
ax2.set_xticks(major_ticks)
ax2.set_yticks(major_ticks)
sc = plt.scatter(bob2[:-1,4],bob2[:-1,2],cmap=cmap,c=z,s=45,zorder=2)
ax3 = plt.subplot(gs[2],aspect='equal',xlim=[0,2],ylim=[0,1])
plt.plot(z,z,color='black',zorder=1)
ax3.grid(which='major', alpha=0.5)
sc = plt.scatter(bob3[:-1,4],bob3[:-1,2],cmap=cmap,c=z,s=45,zorder=2)
ax4 = plt.subplot(gs[3],aspect='equal',xlim=[0,2],ylim=[0,1.5],zorder=2)
plt.plot(z,z,color='black',zorder=1)
ax4.grid(which='major', alpha=0.5)
sc = plt.scatter(bob4[:-1,4],bob4[:-1,2],cmap=cmap,c=z,s=45,zorder=2)
ax5 = plt.subplot(gs[4],aspect='equal',xlim=[0,3],ylim=[0,3])
plt.plot(z,z,color='black',zorder=1)
ax5.grid(which='major', alpha=0.5)
major_ticks = np.arange(0, 3, 1.0)
ax5.set_xticks(major_ticks)
ax5.set_yticks(major_ticks)
sc = plt.scatter(bob5[:-1,4],bob5[:-1,2],cmap=cmap,c=z,s=45,zorder=2)
cbar_ax = fig.add_axes([0.8, 0.3, 0.03, 0.4])
cbar = fig.colorbar(sc, cax=cbar_ax)
cbar.set_ticks([0,6.45,13])
cbar.set_ticklabels([14,7,0])