Skip to content

Commit

Permalink
Merge pull request #2836 from tacaswell/set_size_doc
Browse files Browse the repository at this point in the history
DOC/ENH : get/set_size_inches
  • Loading branch information
NelleV committed Apr 8, 2014
2 parents 7feeb0e + 08b68c2 commit 99d5012
Showing 1 changed file with 21 additions and 2 deletions.
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

0 comments on commit 99d5012

Please sign in to comment.