Skip to content

DOC/ENH : get/set_size_inches #2836

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 3 commits into from
Apr 8, 2014
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
23 changes: 21 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def set_size_inches(self, *args, **kwargs):
"""
set_size_inches(w,h, forward=False)

Set the figure size in inches
Set the figure size in inches (1in == 2.54cm)

Usage::

Expand All @@ -635,6 +635,11 @@ def set_size_inches(self, *args, **kwargs):
from the shell

ACCEPTS: a w,h tuple with w,h in inches

See Also
--------

:func:`~matplotlib.Figure.get_size_inches`
"""

forward = kwargs.get('forward', False)
Expand All @@ -655,7 +660,21 @@ def set_size_inches(self, *args, **kwargs):
manager.resize(int(canvasw), int(canvash))

def get_size_inches(self):
return self.bbox_inches.p1
"""
Returns the current size of the figure in inches (1in == 2.54cm)
as an numpy array.

Returns
-------
size : ndarray
The size of the figure in inches

See Also
--------

:func:`~matplotlib.Figure.set_size_inches`
"""
return np.array(self.bbox_inches.p1)

def get_edgecolor(self):
'Get the edge color of the Figure rectangle'
Expand Down