Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3780812

Browse files
authored
Merge pull request #9947 from matplotlib/auto-backport-of-pr-9942
Backport PR #9942 on branch v2.1.x
2 parents 8f6d41e + 85811f2 commit 3780812

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

lib/matplotlib/pyplot.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# Note: The first part of this file can be modified in place, but the latter
22
# part is autogenerated by the boilerplate.py script.
3+
34
"""
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.
57
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::
910
1011
import numpy as np
1112
import matplotlib.pyplot as plt
1213
13-
x = np.arange(0, 5, 0.1);
14+
x = np.arange(0, 5, 0.1)
1415
y = np.sin(x)
1516
plt.plot(x, y)
1617
18+
The object-oriented API is recommended for more complex plots.
1719
"""
1820
from __future__ import (absolute_import, division, print_function,
1921
unicode_literals)
@@ -260,13 +262,13 @@ def isinteractive():
260262

261263

262264
def ioff():
263-
'Turn interactive mode off.'
265+
"""Turn interactive mode off."""
264266
matplotlib.interactive(False)
265267
uninstall_repl_displayhook()
266268

267269

268270
def ion():
269-
'Turn interactive mode on.'
271+
"""Turn interactive mode on."""
270272
matplotlib.interactive(True)
271273
install_repl_displayhook()
272274

@@ -281,6 +283,8 @@ def pause(interval):
281283
This can be used for crude animation. For more complex animation, see
282284
:mod:`matplotlib.animation`.
283285
286+
Note
287+
----
284288
This function is experimental; its behavior may be changed or extended in a
285289
future release.
286290
"""
@@ -580,8 +584,7 @@ def _auto_draw_if_interactive(fig, val):
580584

581585

582586
def gcf():
583-
"Get a reference to the current figure."
584-
587+
"""Get a reference to the current figure."""
585588
figManager = _pylab_helpers.Gcf.get_active()
586589
if figManager is not None:
587590
return figManager.canvas.figure
@@ -599,7 +602,7 @@ def get_fignums():
599602

600603

601604
def get_figlabels():
602-
"Return a list of existing figure labels."
605+
"""Return a list of existing figure labels."""
603606
figManagers = _pylab_helpers.Gcf.get_all_fig_managers()
604607
figManagers.sort(key=lambda m: m.num)
605608
return [m.canvas.figure.get_label() for m in figManagers]
@@ -629,9 +632,9 @@ def close(*args):
629632
630633
``close()`` by itself closes the current figure
631634
632-
``close(h)`` where *h* is a :class:`Figure` instance, closes that figure
635+
``close(fig)`` closes the `~.Figure` instance *fig*
633636
634-
``close(num)`` closes figure number *num*
637+
``close(num)`` closes the figure number *num*
635638
636639
``close(name)`` where *name* is a string, closes figure with that label
637640
@@ -827,7 +830,6 @@ def hold(b=None):
827830
def ishold():
828831
"""
829832
Return the hold status of the current axes.
830-
831833
"""
832834
return gca()._hold
833835

@@ -1325,8 +1327,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
13251327
"""
13261328
Automatically adjust subplot parameters to give specified padding.
13271329
1328-
Parameters:
1329-
1330+
Parameters
1331+
----------
13301332
pad : float
13311333
padding between the figure edge and the edges of subplots, as a fraction of the font-size.
13321334
h_pad, w_pad : float
@@ -1336,8 +1338,8 @@ def tight_layout(pad=1.08, h_pad=None, w_pad=None, rect=None):
13361338
(left, bottom, right, top) in the normalized figure
13371339
coordinate that the whole subplots area (including
13381340
labels) will fit into. Default is (0, 0, 1, 1).
1339-
"""
13401341
1342+
"""
13411343
fig = gcf()
13421344
fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
13431345

0 commit comments

Comments
 (0)