divider = make_axes_locatable(ax1)
ax2 = divider.append_axes('bottom', size='100%', pad=0.5)
ax3 = divider.append_axes('bottom', size='100%', pad=1)
Adjust the distance only between two subplots in matplotlib