Combine two subplots using subplots and GridSpec
Sometimes we want to combine two subplots in an Axes layout created with
subplots. We can get the GridSpec from the Axes
and then remove the covered Axes and fill the gap with a new bigger Axes.
Here we create a layout with the bottom two Axes in the last column combined.
To start with this layout (rather than removing the overlapping Axes) use
subplot_mosaic.
See also Arranging multiple Axes in a Figure.
