@@ -4130,33 +4130,24 @@ def _set_view_from_bbox(self, bbox, direction='in',
4130
4130
Whether this axis is twinned in the *y*-direction.
4131
4131
"""
4132
4132
if len (bbox ) == 3 :
4133
- Xmin, Xmax = self .get_xlim ()
4134
- Ymin , Ymax = self .get_ylim ()
4135
-
4136
4133
xp , yp , scl = bbox # Zooming code
4137
-
4138
4134
if scl == 0 : # Should not happen
4139
4135
scl = 1.
4140
-
4141
4136
if scl > 1 :
4142
4137
direction = 'in'
4143
4138
else :
4144
4139
direction = 'out'
4145
4140
scl = 1 / scl
4146
-
4147
4141
# 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 ()]))
4152
4144
# set the range
4153
4145
xwidth = xmax - xmin
4154
4146
ywidth = ymax - ymin
4155
4147
xcen = (xmax + xmin )* .5
4156
4148
ycen = (ymax + ymin )* .5
4157
4149
xzc = (xp * (scl - 1 ) + xcen )/ scl
4158
4150
yzc = (yp * (scl - 1 ) + ycen )/ scl
4159
-
4160
4151
bbox = [xzc - xwidth / 2. / scl , yzc - ywidth / 2. / scl ,
4161
4152
xzc + xwidth / 2. / scl , yzc + ywidth / 2. / scl ]
4162
4153
elif len (bbox ) != 4 :
@@ -4209,8 +4200,10 @@ def _set_view_from_bbox(self, bbox, direction='in',
4209
4200
4210
4201
if not twinx and mode != "y" :
4211
4202
self .set_xbound (new_xbound )
4203
+ self .set_autoscalex_on (False )
4212
4204
if not twiny and mode != "x" :
4213
4205
self .set_ybound (new_ybound )
4206
+ self .set_autoscaley_on (False )
4214
4207
4215
4208
def start_pan (self , x , y , button ):
4216
4209
"""
0 commit comments