@@ -4130,33 +4130,24 @@ def _set_view_from_bbox(self, bbox, direction='in',
41304130 Whether this axis is twinned in the *y*-direction.
41314131 """
41324132 if len (bbox ) == 3 :
4133- Xmin , Xmax = self .get_xlim ()
4134- Ymin , Ymax = self .get_ylim ()
4135-
41364133 xp , yp , scl = bbox # Zooming code
4137-
41384134 if scl == 0 : # Should not happen
41394135 scl = 1.
4140-
41414136 if scl > 1 :
41424137 direction = 'in'
41434138 else :
41444139 direction = 'out'
41454140 scl = 1 / scl
4146-
41474141 # get the limits of the axes
4148- tranD2C = self .transData .transform
4149- xmin , ymin = tranD2C ((Xmin , Ymin ))
4150- xmax , ymax = tranD2C ((Xmax , Ymax ))
4151-
4142+ (xmin , ymin ), (xmax , ymax ) = self .transData .transform (
4143+ np .transpose ([self .get_xlim (), self .get_ylim ()]))
41524144 # set the range
41534145 xwidth = xmax - xmin
41544146 ywidth = ymax - ymin
41554147 xcen = (xmax + xmin )* .5
41564148 ycen = (ymax + ymin )* .5
41574149 xzc = (xp * (scl - 1 ) + xcen )/ scl
41584150 yzc = (yp * (scl - 1 ) + ycen )/ scl
4159-
41604151 bbox = [xzc - xwidth / 2. / scl , yzc - ywidth / 2. / scl ,
41614152 xzc + xwidth / 2. / scl , yzc + ywidth / 2. / scl ]
41624153 elif len (bbox ) != 4 :
@@ -4209,8 +4200,10 @@ def _set_view_from_bbox(self, bbox, direction='in',
42094200
42104201 if not twinx and mode != "y" :
42114202 self .set_xbound (new_xbound )
4203+ self .set_autoscalex_on (False )
42124204 if not twiny and mode != "x" :
42134205 self .set_ybound (new_ybound )
4206+ self .set_autoscaley_on (False )
42144207
42154208 def start_pan (self , x , y , button ):
42164209 """
0 commit comments