@@ -4,41 +4,69 @@ API Reference
44Matplotlib interfaces
55---------------------
66
7- Matplotlib provides two different interfaces:
8-
9- - **Axes interface **: create a `.Figure ` and one or more `~.axes.Axes ` objects
10- (typically using `.pyplot.subplots `), then *explicitly * use methods on these objects
11- to add data, configure limits, set labels etc.
12- - **pyplot interface **: consists of functions in the `.pyplot ` module. Figure and Axes
13- are manipulated through these functions and are only *implicitly * present in the
14- background.
15-
16- See :ref: `api_interfaces ` for a more detailed description of both and their recommended
17- use cases.
7+ Matplotlib has two interfaces. See :ref: `api_interfaces ` for a more detailed
8+ description of both and their recommended use cases.
189
1910.. grid :: 1 1 2 2
20- :padding: 0 0 1 1
11+ :padding: 0
12+ :gutter: 2
2113
2214 .. grid-item-card ::
15+ :shadow: none
16+ :class-footer: api-interface-footer
2317
2418 **Axes interface ** (object-based, explicit)
25- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+ create a `.Figure ` and one or more `~.axes.Axes ` objects, then *explicitly * use
21+ methods on these objects to add data, configure limits, set labels etc.
22+
23+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2624
2725 API:
2826
2927 - `~.pyplot.subplots `: create Figure and Axes
3028 - :mod: `~matplotlib.axes `: add data, limits, labels etc.
3129 - `.Figure `: for figure-level methods
3230
31+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32+
33+ Example:
34+
35+ .. code-block :: python
36+ :class : api- interface- example
37+
38+ fig, ax = plt.subplots()
39+ ax.plot(x, y)
40+ ax.set_title(" Sample plot" )
41+ plt.show()
42+
43+
3344 .. grid-item-card ::
45+ :shadow: none
46+ :class-footer: api-interface-footer
3447
3548 **pyplot interface ** (function-based, implicit)
36- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49+
50+ consists of functions in the `.pyplot ` module. Figure and Axes are manipulated
51+ through these functions and are only *implicitly * present in the background.
52+
53+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3754
3855 API:
3956
4057 - `matplotlib.pyplot `
4158
59+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60+
61+ Example:
62+
63+ .. code-block :: python
64+ :class : api- interface- example
65+
66+ plt.plot(x, y)
67+ plt.title(" Sample plot" )
68+ plt.show()
69+
4270
4371 .. _api-index :
4472
0 commit comments