Skip to content

numpydoc set_size_inches docstring #15044

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
Aug 13, 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
18 changes: 12 additions & 6 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,18 +876,24 @@ def figimage(self, X, xo=0, yo=0, alpha=None, norm=None, cmap=None,
return im

def set_size_inches(self, w, h=None, forward=True):
"""Set the figure size in inches.
"""
Set the figure size in inches.

Call signatures::

fig.set_size_inches(w, h) # OR
fig.set_size_inches((w, h))

optional kwarg *forward=True* will cause the canvas size to be
automatically updated; e.g., you can resize the figure window
from the shell

ACCEPTS: a (w, h) tuple with w, h in inches
Parameters
----------
w : (float, float) or float
Width and height in inches (if height not specified as a separate
argument) or width.
h : float
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
h : float
h : float, optional

Specifying the default here does not make lots of sense due to the weird interaction with w.

Height in inches.
forward : bool, default: True
If ``True``, the canvas size is automatically updated, e.g.,
you can resize the figure window from the shell.

See Also
--------
Expand Down