@@ -4292,33 +4292,24 @@ def _set_view_from_bbox(self, bbox, direction='in',
4292
4292
Whether this axis is twinned in the *y*-direction.
4293
4293
"""
4294
4294
if len (bbox ) == 3 :
4295
- Xmin , Xmax = self .get_xlim ()
4296
- Ymin , Ymax = self .get_ylim ()
4297
-
4298
4295
xp , yp , scl = bbox # Zooming code
4299
-
4300
4296
if scl == 0 : # Should not happen
4301
4297
scl = 1.
4302
-
4303
4298
if scl > 1 :
4304
4299
direction = 'in'
4305
4300
else :
4306
4301
direction = 'out'
4307
4302
scl = 1 / scl
4308
-
4309
4303
# 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 ()]))
4314
4306
# set the range
4315
4307
xwidth = xmax - xmin
4316
4308
ywidth = ymax - ymin
4317
4309
xcen = (xmax + xmin )* .5
4318
4310
ycen = (ymax + ymin )* .5
4319
4311
xzc = (xp * (scl - 1 ) + xcen )/ scl
4320
4312
yzc = (yp * (scl - 1 ) + ycen )/ scl
4321
-
4322
4313
bbox = [xzc - xwidth / 2. / scl , yzc - ywidth / 2. / scl ,
4323
4314
xzc + xwidth / 2. / scl , yzc + ywidth / 2. / scl ]
4324
4315
elif len (bbox ) != 4 :
@@ -4371,8 +4362,10 @@ def _set_view_from_bbox(self, bbox, direction='in',
4371
4362
4372
4363
if not twinx and mode != "y" :
4373
4364
self .set_xbound (new_xbound )
4365
+ self .set_autoscalex_on (False )
4374
4366
if not twiny and mode != "x" :
4375
4367
self .set_ybound (new_ybound )
4368
+ self .set_autoscaley_on (False )
4376
4369
4377
4370
def start_pan (self , x , y , button ):
4378
4371
"""
0 commit comments