8000 Have set_figheight and set_figwidth call set_size_inches · matplotlib/matplotlib@ee1a599 · GitHub
[go: up one dir, main page]

Skip to content

Commit ee1a599

Browse files
committed
Have set_figheight and set_figwidth call set_size_inches
1 parent 545c2a0 commit ee1a599

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/figure.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -766,23 +766,21 @@ def set_dpi(self, val):
766766
self.dpi = val
767767
self.stale = True
768768

769-
def set_figwidth(self, val):
769+
def set_figwidth(self, val, **kwargs):
770770
"""
771771
Set the width of the figure in inches
772772
773773
ACCEPTS: float
774774
"""
775-
self.bbox_inches.x1 = val
776-
self.stale = True
775+
self.set_size_inches(val, self.get_figheight(), **kwargs)
777776

778-
def set_figheight(self, val):
777+
def set_figheight(self, val, **kwargs):
779778
"""
780779
Set the height of the figure in inches
781780
782781
ACCEPTS: float
783782
"""
784-
self.bbox_inches.y1 = val
785-
self.stale = True
783+
self.set_size_inches(self.get_figwidth(), val, **kwargs)
786784

787785
def set_frameon(self, b):
788786
"""

0 commit comments

Comments
 (0)
0