Matplotlib: enforce equal size (height) of subplots?
问题 I have a figure containing three subplots. The first subplot is an image ( imshow ), while the other two are distributions ( plot ). Here's the code: # collects data imgdata = ... # img of shape (800, 1600, 3) x = ... # one 1600-dimensional vector y = ... # one 800-dimensional vector # create the figure f = plt.figure() # create subplots subplot_dim = (1, 3) p_img = plt.subplot2grid(subplot_dim, (0, 0), aspect="auto") p_x = plt.subplot2grid(subplot_dim, (0, 1), aspect="auto") p_y = plt