You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d454304
Browse filesBrowse the repository at this point in the historyBrowse files
Updated the Chinese and English documentation for the single_group.md file with:
- Corrected section heading from '多子图' to '多坐标系'
- Improved clarity and consistency in explanations
- Fixed formatting issues in code blocks and markdown structure
- Updated example content to reflect current API usage
- Maintained consistent terminology across both language versions
Copy file name to clipboardExpand all lines: docs/en/index.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,45 @@ The project adopts a modular design, containing the following main functional mo
24
24
25
25
---
26
26
27
+
## Core Three Elements of Matplotlib: Figure, Axes, and Subplot
28
+
27
29
Fun fact: All elements of a figure[^1].
30
+
28
31

29
32
33
+
When using Matplotlib to create plots, Figure, Axes, and Subplot are the three most fundamental and essential concepts.
34
+
Understanding the relationship among them is key to mastering Matplotlib's underlying logic.
35
+
36
+
### Figure (Canvas / Graphic Window)
37
+
38
+
A Figure is the top‑level container for the entire plotting.
39
+
You can think of it as a blank canvas or the graphic window that appears on your screen.
40
+
The Figure holds all plotting elements.
41
+
42
+
You can set global properties on it, such as the overall size (figsize), background color, resolution (dpi), etc.
43
+
44
+
### Axes (Coordinate System / Plotting Area)
45
+
46
+
Axes are the actual “plotting area” in Matplotlib, and where most of the data manipulation and drawing happens.
47
+
An Axes is a rectangular region equipped with a data coordinate system.
48
+
It includes not only the graphical elements you draw (lines, scatter points, bars, etc.) but also all auxiliary components such as the X‑axis, Y‑axis, tick labels, axis labels, titles, and more.
49
+
50
+
A single Figure can contain multiple Axes objects.
51
+
These Axes can be arranged in a regular grid, or they can be placed freely anywhere on the canvas, independent of any grid.
52
+
53
+
### Subplot (Sub‑plot / Grid Partition)
54
+
55
+
A Subplot is a special term for an Axes that is placed in a regular grid.
56
+
When you want to display multiple charts neatly on one canvas (for example, a vertical comparison or a 2×2 layout), you divide the canvas into a regular grid.
57
+
Each grid cell then contains an Axes, and that Axes is called a Subplot.
58
+
59
+
In essence, a Subplot is exactly the same as an Axes.
60
+
They share the same properties and methods (both can be used for plotting and for setting axis properties).
61
+
The only difference is that Subplots are created in batch using the subplots() function, which arranges them in a predefined grid.
62
+
63
+
!!! info
64
+
Subplot: specifically refers to an Axes that is generated via subplots() or add_subplot() within a regular grid.
65
+
66
+
Axes: a broader concept. It includes not only grid‑based subplots, but also axes placed arbitrarily on the canvas using `add_axes([left, bottom, width, height])`, as well as embedded inset axes (Inset Axes) nested inside a main plot.
67
+
30
68
[^1]: [Quick start guide of matplotlib.](https://matplotlib.org/stable/tutorials/introductory/usage.html#parts-of-a-figure)
0 commit comments