I have a matplotlib plot in python with 3 subplots, all in 1 column.
I currently control the height of each subplot with:
gridspec.GridSpec(3, 1, hei
In this particular case it's probably quickest to just add an invisible axes object between rows 2 and 3:
import matplotlib.pyplot as plt
gridspec = dict(hspace=0.0, height_ratios=[1, 1, 0.4, 3])
fig, axs = plt.subplots(nrows=4, ncols=1, gridspec_kw=gridspec)
axs[2].set_visible(False)
I looked through the documentation and it appears that variable grid spacing is not supported. So we have to make do with workarounds like this one.