8000 Set figure width and height with set_size_inches by jhamrick · Pull Request #4677 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Set figure width and height with set_size_inches #4677

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
Jul 15, 2015
Merged
Changes from 1 commit
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
Next Next commit
Have set_figheight and set_figwidth call set_size_inches
  • Loading branch information
jhamrick committed Jul 13, 2015
commit ee1a599c38a91a4736a58d36a85d3cbb643a2c54
10 changes: 4 additions & 6 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,23 +766,21 @@ def set_dpi(self, val):
self.dpi = val
self.stale = True

def set_figwidth(self, val):
def set_figwidth(self, val, **kwargs):
"""
Set the width of the figure in inches

ACCEPTS: float
"""
self.bbox_inches.x1 = val
self.stale = True
self.set_size_inches(val, self.get_figheight(), **kwargs)

def set_figheight(self, val):
def set_figheight(self, val, **kwargs):
"""
Set the height of the figure in inches

ACCEPTS: float
"""
self.bbox_inches.y1 = val
self.stale = True
self.set_size_inches(self.get_figwidth(), val, **kwargs)

def set_frameon(self, b):
"""
Expand Down
0