If I have, for example, these 3 datasets to plot:
a = np.arange(0,10,1)
b = np.arange(2,6,1)
c = np.arange(5,10,1)
After doing a lot of research, it looks like there really isn't any simple command to do this. But first, giving a thought of the range of both x and y values of each subplot and their ratios, and the layout, GridSpec will do the job.
So for our example, the layout is as presented in the question, i.e. the biggest picture on top, the two smaller ones next to each other underneath. To make it easier, the y range is the same for all of them (but if it wasn't we would use the same calculations as for x). Now, knowing this layout, we can create a grid. The vertical span is 20 (because we have two rows of 4 plots with y-range 10) and we may want some space between them for axis labels, legend etc., so we'll add extra 5. The first plot has x range of 10, However, the second and third figures have the range of 4 and 5, which is 9 in total, and we may also want some space between them, so let us add 3 extra. So the horizontal grid will span over 12. Hence, we create a grid 25 x 12 and fit our plots in this grid as follows:
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec ## GRIDSPEC INTRO - creating a grid to distribute the subplots with same scales and different sizes. fig = plt.figure() gs=gridspec.GridSpec(25,12) ## SUBPLOTS of GRIDSPEC #the first (big) plot axes1 = plt.subplot(gs[:10,:10]) ax1 = plt.plot(x,y) # plot some data here ax1 = plt.xlim(1,10) ax1 = plt.ylim(1,10) # the second plot below the big one on the left axes2 = plt.subplot(gs[15:,:4]) ax2 = plt.plot(x,y) # plot some data here ax2 = plt.xlim(2,6) ax2 = plt.ylim(1,10) # the third plot - below the big one on the right axes3 = plt.subplot(gs[15:,7:]) ax3 = plt.plot(x,y) # plot some data here ax3 = plt.xlim(5,10) ax3 = plt.ylim(1,10) plt.show()