@@ -1164,7 +1164,7 @@ def _set_view_from_bbox(self, bbox, direction='in',
1164
1164
Will center the view on the center of the bounding box, and zoom by
1165
1165
the ratio of the size of the bounding box to the size of the Axes3D.
1166
1166
"""
1167
- (start_x , start_y , stop_x , stop_y ) = self . _prepare_view_from_bbox ( bbox )
1167
+ (start_x , start_y , stop_x , stop_y ) = bbox
1168
1168
if mode == 'x' :
1169
1169
start_y = self .bbox .min [1 ]
1170
1170
stop_y = self .bbox .max [1 ]
@@ -1200,44 +1200,6 @@ def _set_view_from_bbox(self, bbox, direction='in',
1200
1200
1201
1201
self ._zoom_data_limits (scale_x , scale_y , scale_z )
1202
1202
1203
- def _prepare_view_from_bbox (self , bbox , direction = 'in' ,
1204
- mode = None , twinx = False , twiny = False ):
1205
- """
1206
- Helper function to prepare the new bounds from a bbox.
1207
- This helper function returns the new x and y bounds from the zoom
1208
- bbox. This a convenience method to abstract the bbox logic
1209
- out of the base setter.
1210
- """
1211
- if len (bbox ) == 3 :
1212
- xp , yp , scl = bbox # Zooming code
1213
- if scl == 0 : # Should not happen
1214
- scl = 1.
1215
- if scl > 1 :
1216
- direction = 'in'
1217
- else :
1218
- direction = 'out'
1219
- scl = 1 / scl
1220
- # get the limits of the axes
1221
- (xmin , ymin ), (xmax , ymax ) = self .transData .transform (
1222
- np .transpose ([self .get_xlim (), self .get_ylim ()]))
1223
- # set the range
1224
- xwidth = xmax - xmin
1225
- ywidth = ymax - ymin
1226
- xcen = (xmax + xmin ) * .5
1227
- ycen = (ymax + ymin ) * .5
1228
- xzc = (xp * (scl - 1 ) + xcen ) / scl
1229
- yzc = (yp * (scl - 1 ) + ycen ) / scl
1230
- bbox = [xzc - xwidth / 2. / scl , yzc - ywidth / 2. / scl ,
1231
- xzc + xwidth / 2. / scl , yzc + ywidth / 2. / scl ]
1232
- elif len (bbox ) != 4 :
1233
- # should be len 3 or 4 but nothing else
1234
- _api .warn_external (
1235
- "Warning in _set_view_from_bbox: bounding box is not a tuple "
1236
- "of length 3 or 4. Ignoring the view change." )
1237
- return
1238
-
1239
- return bbox
1240
-
1241
1203
def _zoom_data_limits (self , scale_x , scale_y , scale_z ):
1242
1204
"""
1243
1205
Zoom in or out of a 3D plot.
0 commit comments