I’m very new to python and matplotlib and having trouble with adjusting the height of a 2 plot subplot window. I’m trying to make the subplots aligned vertically, with one directly on top of the other. The subplot on the bottom should be half the height as the one on top. If I try and use width_ratios I get exactly what I would expect (though it’s not what I want). But when I use height_ratios I get both plots aligned horizontally with empty space below them both that is half the height of the subplots. The relevant portion of the code is below
pl.figure()
grid = gs.GridSpec(1, 2, height_ratios=[2,1])
ax1 = pl.subplot(grid[0])
ax2 = pl.subplot(grid[1])
I’m sure I’m doing something very simple (and probably dumb) but to my newbie eyes I can’t see it.
You switched rows and columns in your Gridspec statement:
works.