@@ -4292,33 +4292,24 @@ def _set_view_from_bbox(self, bbox, direction='in',
42924292 Whether this axis is twinned in the *y*-direction.
42934293 """
42944294 if len (bbox ) == 3 :
4295- Xmin , Xmax = self .get_xlim ()
4296- Ymin , Ymax = self .get_ylim ()
4297-
42984295 xp , yp , scl = bbox # Zooming code
4299-
43004296 if scl == 0 : # Should not happen
43014297 scl = 1.
4302-
43034298 if scl > 1 :
43044299 direction = 'in'
43054300 else :
43064301 direction = 'out'
43074302 scl = 1 / scl
4308-
43094303 # get the limits of the axes
4310- tranD2C = self .transData .transform
4311- xmin , ymin = tranD2C ((Xmin , Ymin ))
4312- xmax , ymax = tranD2C ((Xmax , Ymax ))
4313-
4304+ (xmin , ymin ), (xmax , ymax ) = self .transData .transform (
4305+ np .transpose ([self .get_xlim (), self .get_ylim ()]))
43144306 # set the range
43154307 xwidth = xmax - xmin
43164308 ywidth = ymax - ymin
43174309 xcen = (xmax + xmin )* .5
43184310 ycen = (ymax + ymin )* .5
43194311 xzc = (xp * (scl - 1 ) + xcen )/ scl
43204312 yzc = (yp * (scl - 1 ) + ycen )/ scl
4321-
43224313 bbox = [xzc - xwidth / 2. / scl , yzc - ywidth / 2. / scl ,
43234314 xzc + xwidth / 2. / scl , yzc + ywidth / 2. / scl ]
43244315 elif len (bbox ) != 4 :
@@ -4371,8 +4362,10 @@ def _set_view_from_bbox(self, bbox, direction='in',
43714362
43724363 if not twinx and mode != "y" :
43734364 self .set_xbound (new_xbound )
4365+ self .set_autoscalex_on (False )
43744366 if not twiny and mode != "x" :
43754367 self .set_ybound (new_ybound )
4368+ self .set_autoscaley_on (False )
43764369
43774370 def start_pan (self , x , y , button ):
43784371 """
0 commit comments