Most of the explanation was already given in the previous recipe:
- fig = plt.figure(figsize=(8,8), constrained_layout=True) specifies the figure size, sets constrained_layout, and instantiates the figure.
- fig.set_constrained_layout_pads(w_pad=2./72., h_pad=2./72., hspace=0.2, wspace=0.2) ensures the proper alignment and spacing between the plots in the grid:
- It has four arguments, which we can set to control the spacing between the plots.
- w_pad and h_pad are specified in inches and are fixed in the data co-ordinate system, so even if the figure size changes, the space between the plots does not change as it is a fixed space.
- When we specify wspace and hspace, which are in the figure co-ordinate system, if the figure size ...