@@ -659,7 +659,7 @@ def figimage(self, X,
659
659
self .stale = True
660
660
return im
661
661
662
- def set_size_inches (self , * args , ** kwargs ):
662
+ def set_size_inches (self , w , h = None , forward = False ):
663
663
"""
664
664
set_size_inches(w,h, forward=False)
665
665
@@ -682,11 +682,10 @@ def set_size_inches(self, *args, **kwargs):
682
682
matplotlib.Figure.get_size_inches
683
683
"""
684
684
685
- forward = kwargs .get ('forward' , False )
686
- if len (args ) == 1 :
687
- w , h = args [0 ]
688
- else :
689
- w , h = args
685
+ # the width and height have been passed in as a tuple to the first
686
+ # argument, so unpack them
687
+ if h is None :
688
+ w , h = w
690
689
691
690
dpival = self .dpi
692
691
self .bbox_inches .p1 = w , h
@@ -766,21 +765,21 @@ def set_dpi(self, val):
766
765
self .dpi = val
767
766
self .stale = True
768
767
769
- def set_figwidth (self , val , ** kwargs ):
768
+ def set_figwidth (self , val , forward = False ):
770
769
"""
771
770
Set the width of the figure in inches
772
771
F3B6
773
772
ACCEPTS: float
774
773
"""
775
- self .set_size_inches (val , self .get_figheight (), ** kwargs )
774
+ self .set_size_inches (val , self .get_figheight (), forward = forward )
776
775
777
- def set_figheight (self , val , ** kwargs ):
776
+ def set_figheight (self , val , forward = False ):
778
777
"""
779
778
Set the height of the figure in inches
780
779
781
780
ACCEPTS: float
782
781
"""
783
- self .set_size_inches (self .get_figwidth (), val , ** kwargs )
782
+ self .set_size_inches (self .get_figwidth (), val , forward = forward )
784
783
785
784
def set_frameon (self , b ):
786
785
"""
0 commit comments