1
1
API Overview
2
2
============
3
3
4
- Below we describe several common approaches to plotting with Matplotlib. See
5
- also the :doc: `api_changes `.
6
-
7
4
.. toctree ::
8
5
:hidden:
9
6
10
7
api_changes
11
8
12
9
.. contents :: :local:
13
10
14
- The pyplot API
11
+ See also the :doc: `api_changes `.
12
+
13
+ Usage patterns
15
14
--------------
16
15
16
+ Below we describe several common approaches to plotting with Matplotlib.
17
+
18
+ The pyplot API
19
+ ^^^^^^^^^^^^^^
20
+
17
21
`matplotlib.pyplot ` is a collection of command style functions that make
18
22
Matplotlib work like MATLAB. Each pyplot function makes some change to a
19
23
figure: e.g., creates a figure, creates a plotting area in a figure, plots
@@ -31,7 +35,7 @@ Further reading:
31
35
.. _api-index :
32
36
33
37
The object-oriented API
34
- -----------------------
38
+ ^^^^^^^^^^^^^^^^^^^^^^^
35
39
36
40
At its core, Matplotlib is object-oriented. We recommend directly working
37
41
with the objects, if you need more control and customization of your plots.
@@ -48,7 +52,23 @@ Further reading:
48
52
- Most of the :ref: `examples <examples-index >` use the object-oriented approach
49
53
(except for the pyplot section)
50
54
51
- All Matplotlib submodules are documented here:
55
+ The pylab API (disapproved)
56
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
57
+
58
+ .. warning ::
59
+ Since heavily importing into the global namespace may result in unexpected
60
+ behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot `
61
+ instead.
62
+
63
+ `pylab ` is a module that includes `matplotlib.pyplot `, `numpy `
64
+ and some additional functions within a single namespace. Its original purpose
65
+ was to mimic a MATLAB-like way of working by importing all functions into the
66
+ global namespace. This is considered bad style nowadays.
67
+
68
+ Modules
69
+ -------
70
+
71
+ Matplotlib consists of the following submodules:
52
72
53
73
.. toctree ::
54
74
:maxdepth: 1
@@ -109,7 +129,11 @@ All Matplotlib submodules are documented here:
109
129
units_api.rst
110
130
widgets_api.rst
111
131
112
- ... and the ``mpl_toolkits `` here:
132
+ Toolkits
133
+ --------
134
+
135
+ :ref: `toolkits-index ` are collections of application-specific functions that extend
136
+ Matplotlib. The following toolkits are included:
113
137
114
138
.. toctree ::
115
139
:maxdepth: 1
@@ -119,17 +143,3 @@ All Matplotlib submodules are documented here:
119
143
toolkits/axes_grid1.rst
120
144
toolkits/axisartist.rst
121
145
toolkits/axes_grid.rst
122
-
123
-
124
- The pylab API (disapproved)
125
- ---------------------------
126
-
127
- .. warning ::
128
- Since heavily importing into the global namespace may result in unexpected
129
- behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot `
130
- instead.
131
-
132
- `matplotlib.pylab ` is a module that includes `matplotlib.pyplot `, `numpy `
133
- and some additional functions within a single namespace. Its original purpose
134
- was to mimic a MATLAB-like way of working by importing all functions into the
135
- global namespace. This is considered bad style nowadays.
0 commit comments