numpy - adjusting heights of individual subplots in matplotlib in Python -
if have series of subplots 1 column , many rows, i.e.:
plt.subplot(4, 1, 1) # first subplot plt.subplot(4, 1, 2) # second subplot # ...
how can adjust height of first n subplots? example, if have 4 subplots, each on own row, want of them have same width first 3 subplots shorter, i.e. have y-axes smaller , take less of plot y-axis of last plot in row. how can this?
thanks.
there multiple ways this. basic (and least flexible) way call like:
import matplotlib.pyplot plt plt.subplot(6,1,1) plt.subplot(6,1,2) plt.subplot(6,1,3) plt.subplot(2,1,2)
which give this:
however, isn't flexible. if you're using matplotlib >= 1.0.0, using gridspec. it's quite nice, , more flexible way of laying out subplots.
Comments
Post a Comment