Here is the explanation for the preceding code and how it works:
- To define the figure and canvas, we are using another method, new_figure_manager(), in this recipe just to demonstrate the multiple options Matplotlib provides. We could have used the same methods as in the previous recipe as well. This approach is more suitable for batch processing of multiple figures in a loop. It takes the arguments as figure number and figure size.
- fig.add_subplot(121) instantiates the first axis for the first patch.
- axs1.add_patch(Ellipse((3, 1.0), 4, 1.0, hatch='/', facecolor='g')) adds the ellipse patch on axs1. (3, 1.0) defines the co-ordinates of the center of the ellipse; 4 is the width and 1.0 is height of the ellipse. facecolor