Multiple plots concept

I appreciate if someone can help to explain the multiple plots concepts in an easier way. I am not really clear about the figure, Axex object concepts. So basically we create a place that we call figure in python to store the plots. Many plots can save in one figure. And a figure has various methods to customizing the appearance of every single plot or all plots Did I get it correctly?

pyplot.figure() is the method we use to create a place to save plots
pyplot.figure().add_subplot() is the method we add a plot to the figure that we created.

Hi @candiceliu93

I’m going to try to explain this in a clear way, but it looks like you actually got it right

  1. pyplot.figure() as the doc says is “The top level container for all the plot elements” in other words is the space were all the plots will be
  2. add_subplot() basically creates a figure and a grid of subplots with a single call, while providing reasonable control over how the individual plots are created
  3. axes: contains most of the figure elements like axis, ticks, lines, etc

Check this part of matplotlib’s documentation, they give a better explanation than me

Hope you understand and good luck!

1 Like