Skip to content

Some simple pyplot doc improvements #14109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def switch_backend(newbackend):
def show(*args, **kw):
"""
Display a figure.

When running in ipython with its pylab mode, display all
figures and return to the ipython prompt.

Expand Down Expand Up @@ -335,6 +336,11 @@ def gci():

The current image is an attribute of the current axes, or the nearest
earlier axes in the current figure that contains an image.

Notes
-----
Historically, the only colorable artists were images; hence the name
``gci`` (get current image).
"""
return gcf()._gci()

Expand Down Expand Up @@ -423,7 +429,6 @@ def figure(num=None, # autoincrement if None, else integer from 1-N

Parameters
----------

num : integer or string, optional, default: None
If not provided, a new figure will be created, and the figure number
will be incremented. The figure objects holds this number in a `number`
Expand Down Expand Up @@ -576,7 +581,12 @@ def _auto_draw_if_interactive(fig, val):


def gcf():
"""Get a reference to the current figure."""
"""
Get the current figure.

If no current figure exists, a new one is created using
`~.pyplot.figure()`.
"""
figManager = _pylab_helpers.Gcf.get_active()
if figManager is not None:
return figManager.canvas.figure
Expand All @@ -602,7 +612,19 @@ def get_figlabels():


def get_current_fig_manager():
"""Return ``gcf().canvas.manager``, the current figure's manager."""
"""
Return the figure manager of the current figure.

The figure manager is a container for the actual backend-depended window
that displays the figure on screen.

If if no current figure exists, a new one is created an its figure
manager is returned.

Returns
-------
manager : `.FigureManagerBase` or backend-dependent subclass thereof
"""
return gcf().canvas.manager


Expand Down