Skip to content

Commit 7001b33

Browse files
authored
Merge pull request #14109 from timhoffm/doc-pyplot
Some simple pyplot doc improvements
2 parents fc8638e + 35681b9 commit 7001b33

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

lib/matplotlib/pyplot.py

+25-3
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def switch_backend(newbackend):
245245
def show(*args, **kw):
246246
"""
247247
Display a figure.
248+
248249
When running in ipython with its pylab mode, display all
249250
figures and return to the ipython prompt.
250251
@@ -335,6 +336,11 @@ def gci():
335336
336337
The current image is an attribute of the current axes, or the nearest
337338
earlier axes in the current figure that contains an image.
339+
340+
Notes
341+
-----
342+
Historically, the only colorable artists were images; hence the name
343+
``gci`` (get current image).
338344
"""
339345
return gcf()._gci()
340346

@@ -423,7 +429,6 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
423429
424430
Parameters
425431
----------
426-
427432
num : integer or string, optional, default: None
428433
If not provided, a new figure will be created, and the figure number
429434
will be incremented. The figure objects holds this number in a `number`
@@ -576,7 +581,12 @@ def _auto_draw_if_interactive(fig, val):
576581

577582

578583
def gcf():
579-
"""Get a reference to the current figure."""
584+
"""
585+
Get the current figure.
586+
587+
If no current figure exists, a new one is created using
588+
`~.pyplot.figure()`.
589+
"""
580590
figManager = _pylab_helpers.Gcf.get_active()
581591
if figManager is not None:
582592
return figManager.canvas.figure
@@ -602,7 +612,19 @@ def get_figlabels():
602612

603613

604614
def get_current_fig_manager():
605-
"""Return ``gcf().canvas.manager``, the current figure's manager."""
615+
"""
616+
Return the figure manager of the current figure.
617+
618+
The figure manager is a container for the actual backend-depended window
619+
that displays the figure on screen.
620+
621+
If if no current figure exists, a new one is created an its figure
622+
manager is returned.
623+
624+
Returns
625+
-------
626+
manager : `.FigureManagerBase` or backend-dependent subclass thereof
627+
"""
606628
return gcf().canvas.manager
607629

608630

0 commit comments

Comments
 (0)