1
1
# Note: The first part of this file can be modified in place, but the latter
2
2
# part is autogenerated by the boilerplate.py script.
3
+
3
4
"""
4
- Provides a MATLAB-like plotting framework.
5
+ `matplotlib.pyplot` is a state-based interface to matplotlib. It provides
6
+ a MATLAB-like way of plotting.
5
7
6
- :mod:`~matplotlib.pylab` combines pyplot with numpy into a single namespace.
7
- This is convenient for interactive work, but for programming it
8
- is recommended that the namespaces be kept separate, e.g.::
8
+ pyplot is mainly intended for interactive plots and simple cases of programmatic
9
+ plot generation::
9
10
10
11
import numpy as np
11
12
import matplotlib.pyplot as plt
12
13
13
- x = np.arange(0, 5, 0.1);
14
+ x = np.arange(0, 5, 0.1)
14
15
y = np.sin(x)
15
16
plt.plot(x, y)
16
17
18
+ The object-oriented API is recommended for more complex plots.
17
19
"""
18
20
from __future__ import (absolute_import , division , print_function ,
19
21
unicode_literals )
@@ -260,13 +262,13 @@ def isinteractive():
260
262
261
263
262
264
def ioff ():
263
- ' Turn interactive mode off.'
265
+ """ Turn interactive mode off."""
264
266
matplotlib .interactive (False )
265
267
uninstall_repl_displayhook ()
266
268
267
269
268
270
def ion ():
269
- ' Turn interactive mode on.'
271
+ """ Turn interactive mode on."""
270
272
matplotlib .interactive (True )
271
273
install_repl_displayhook ()
272
274
@@ -281,6 +283,8 @@ def pause(interval):
281
283
This can be used for crude animation. For more complex animation, see
282
284
:mod:`matplotlib.animation`.
283
285
286
+ Note
287
+ ----
284
288
This function is experimental; its behavior may be changed or extended in a
285
289
future release.
286
290
"""
@@ -590,8 +594,7 @@ def _auto_draw_if_interactive(fig, val):
590
594
591
595
592
596
def gcf ():
593
- "Get a reference to the current figure."
594
-
597
+ """Get a reference to the current figure."""
595
598
figManager = _pylab_helpers .Gcf .get_active ()
596
599
if figManager is not None :
597
600
return figManager .canvas .figure
@@ -609,7 +612,7 @@ def get_fignums():
609
612
610
613
611
614
def get_figlabels ():
612
- "Return a list of existing figure labels."
615
+ """ Return a list of existing figure labels."" "
613
616
figManagers = _pylab_helpers .Gcf .get_all_fig_managers ()
614
617
figManagers .sort (key = lambda m : m .num )
615
618
return [m .canvas .figure .get_label () for m in figManagers ]
@@ -639,9 +642,9 @@ def close(*args):
639
642
640
643
``close()`` by itself closes the current figure
641
644
642
- ``close(h )`` where *h* is a :class:` Figure` instance, closes that figure
645
+ ``close(fig )`` closes the `~. Figure` instance *fig*
643
646
644
- ``close(num)`` closes figure number *num*
647
+ ``close(num)`` closes the figure number *num*
645
648
646
649
``close(name)`` where *name* is a string, closes figure with that label
647
650
@@ -837,7 +840,6 @@ def hold(b=None):
837
840
def ishold ():
838
841
"""
839
842
Return the hold status of the current axes.
840
-
841
843
"""
842
844
return gca ()._hold
843
845
@@ -1330,8 +1332,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
1330
1332
"""
1331
1333
Automatically adjust subplot parameters to give specified padding.
1332
1334
1333
- Parameters:
1334
-
1335
+ Parameters
1336
+ ----------
1335
1337
pad : float
1336
1338
padding between the figure edge and the edges of subplots, as a fraction of the font-size.
1337
1339
h_pad, w_pad : float
@@ -1341,8 +1343,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
1341
1343
(left, bottom, right, top) in the normalized figure
1342
1344
coordinate that the whole subplots area (including
1343
1345
labels) will fit into. Default is (0, 0, 1, 1).
1344
- """
1345
1346
1347
+ """
1346
1348
fig = gcf ()
1347
1349
fig .tight_layout (pad = pad , h_pad = h_pad , w_pad = w_pad , rect = rect )
1348
1350
0 commit comments