[matplotlib] Multiple figures in a single file

In this article, I denote the way to draw multiple figures in a single file like the image below using matplotlib


  1. Make sub plot areas using plt.subplots
  2. Draw each area. In this example, I define and use draw_graph_X functions to draw each figure.
In the case you want to remove some sub plot areas, you can use fig.delaxes function.

To share a single legend, make a line_list and label_list like this example and set them to fig.legend function.