What if you could arrange multiple charts perfectly every time without messy guesswork?
Why Figure and Axes mental model in Matplotlib? - Purpose & Use Cases
Imagine you want to draw multiple charts on a single page by hand, like sketching graphs on paper without any guides or frames.
You try to place each chart exactly where you want, but it's hard to keep them aligned and sized properly.
Doing this manually is slow and frustrating because you must measure and adjust each chart's position and size by trial and error.
It's easy to overlap charts or leave too much empty space, making your page look messy and confusing.
The Figure and Axes mental model in matplotlib helps by giving you a clear structure: the Figure is like the whole page, and Axes are the individual charts inside it.
This way, you can easily control where each chart goes and how big it is, without guesswork.
plt.plot(x, y)
plt.plot(x2, y2) # hard to control layoutfig, ax = plt.subplots(2) ax[0].plot(x, y) ax[1].plot(x2, y2) # clear layout control
You can create clean, organized multi-chart layouts that are easy to read and customize.
When making a report with sales data, you can put a bar chart and a line chart side by side, each with its own labels and size, all neatly arranged on one page.
Figure is the whole drawing area or page.
Axes are the individual charts inside the Figure.
This model helps organize multiple charts clearly and easily.