Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47f7000

Browse files
Remove Axes3D._prepare_view_from_bbox for now
1 parent 86f4f64 commit 47f7000

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ def _set_view_from_bbox(self, bbox, direction='in',
11641164
Will center the view on the center of the bounding box, and zoom by
11651165
the ratio of the size of the bounding box to the size of the Axes3D.
11661166
"""
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
11681168
if mode == 'x':
11691169
start_y = self.bbox.min[1]
11701170
stop_y = self.bbox.max[1]
@@ -1200,44 +1200,6 @@ def _set_view_from_bbox(self, bbox, direction='in',
12001200

12011201
self._zoom_data_limits(scale_x, scale_y, scale_z)
12021202

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-
12411203
def _zoom_data_limits(self, scale_x, scale_y, scale_z):
12421204
"""
12431205
Zoom in or out of a 3D plot.

0 commit comments

Comments
 (0)