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
"""
@@ -580,8 +584,7 @@ def _auto_draw_if_interactive(fig, val):
580
584
581
585
582
586
def gcf ():
583
- "Get a reference to the current figure."
584
-
587
+ """Get a reference to the current figure."""
585
588
figManager = _pylab_helpers .Gcf .get_active ()
586
589
if figManager is not None :
587
590
return figManager .canvas .figure
@@ -599,7 +602,7 @@ def get_fignums():
599
602
600
603
601
604
def get_figlabels ():
602
- "Return a list of existing figure labels."
605
+ """ Return a list of existing figure labels."" "
603
606
figManagers = _pylab_helpers .Gcf .get_all_fig_managers ()
604
607
figManagers .sort (key = lambda m : m .num )
605
608
return [m .canvas .figure .get_label () for m in figManagers ]
@@ -629,9 +632,9 @@ def close(*args):
629
632
630
633
``close()`` by itself closes the current figure
631
634
632
- ``close(h )`` where *h* is a :class:` Figure` instance, closes that figure
635
+ ``close(fig )`` closes the `~. Figure` instance *fig*
633
636
634
- ``close(num)`` closes figure number *num*
637
+ ``close(num)`` closes the figure number *num*
635
638
636
639
``close(name)`` where *name* is a string, closes figure with that label
637
640
@@ -827,7 +830,6 @@ def hold(b=None):
827
830
def ishold ():
828
831
"""
829
832
Return the hold status of the current axes.
830
-
831
833
"""
832
834
return gca ()._hold
833
835
@@ -1325,8 +1327,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
1325
1327
"""
1326
1328
Automatically adjust subplot parameters to give specified padding.
1327
1329
1328
- Parameters:
1329
-
1330
+ Parameters
1331
+ ----------
1330
1332
pad : float
1331
1333
padding between the figure edge and the edges of subplots, as a fraction of the font-size.
1332
1334
h_pad, w_pad : float
@@ -1336,8 +1338,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
1336
1338
(left, bottom, right, top) in the normalized figure
1337
1339
coordinate that the whole subplots area (including
1338
1340
labels) will fit into. Default is (0, 0, 1, 1).
1339
- """
1340
1341
1342
+ """
1341
1343
fig = gcf ()
1342
1344
fig .tight_layout (pad = pad , h_pad = h_pad , w_pad = w_pad , rect = rect )
1343
1345
0 commit comments