Figures and Axes
Understand the plotting model.
The Plotting Model
Matplotlib is the foundational plotting library for Python. To use it well you must understand its two-level model: the Figure and the Axes.
A Figure is the overall window or page that everything is drawn on. An Axes is a single plot inside that figure, with its own x and y coordinate system.
- One figure can hold many axes
- Each axes is where the data actually lives
Figure vs Axes vs Axis
Three terms are easy to confuse:
- Figure the whole image, the container
- Axes a single plotting region (note the spelling, it is not the plural of axis)
- Axis the x-axis or y-axis number line inside an axes
So a figure contains axes, and each axes contains two (or three) axis objects.
All lessons in this course
- Figures and Axes
- Line, Bar and Scatter Plots
- Customizing Plots
- Subplots and Layouts