Here is how the code works:
- plt.style.use('seaborn') specifies the seaborn style is to be used.
- gs1 = GridSpec(ncols=3, nrows=3, left=0.05, right=0.5, wspace=0.2, hspace=0.1) creates the first grid:
- ncols and nrows specify the grid layout, a 3 x 3 grid in this case
- left and right co-ordinates are in the figure co-ordinate system and specify where the grid starts from the left and where it ends on the right
- wspace controls the space between plots in a row
- hspace controls the space between plots in a column
- ax1 = fig.add_subplot(gs1[0, 0]) creates an axes instance for the first cell in the gs1 grid.
- patches.Ellipse() defines an ellipse patch whose co-ordinates are specified in the axes co-ordinate system. ax1.add_patch(ellipse) ...