File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
"""
5
5
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
6
- a MATLAB-like way of plotting.
6
+ an implicit, MATLAB-like, way of plotting. It also opens figures on your
7
+ screen, and acts as the figure GUI manager.
7
8
8
9
pyplot is mainly intended for interactive plots and simple cases of
9
10
programmatic plot generation::
15
16
y = np.sin(x)
16
17
plt.plot(x, y)
17
18
18
- The object-oriented API is recommended for more complex plots.
19
+ The explicit (object-oriented) API is recommended for complex plots, though
20
+ pyplot is still usually used to create the figure and often the axes in the
21
+ figure. See `.pyplot.figure`, `.pyplot.subplots`, and
22
+ `.pyplot.subplot_mosaic` to create figures, and
23
+ :doc:`Axes API <../axes_api>` for the plotting methods on an axes::
24
+
25
+ import numpy as np
26
+ import matplotlib.pyplot as plt
27
+
28
+ x = np.arange(0, 5, 0.1)
29
+ y = np.sin(x)
30
+ fig, ax = plt.subplots()
31
+ ax.plot(x, y)
19
32
"""
20
33
21
34
import functools
You can’t perform that action at this time.
0 commit comments