Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f434d6

Browse filesBrowse files
Limit zoom box
1 parent 8a1e166 commit 8f434d6
Copy full SHA for 8f434d6

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,11 @@ def _set_view_from_bbox(self, bbox, direction='in',
11791179
scale_x = dx / (self.bbox.max[0] - self.bbox.min[0])
11801180
scale_y = dy / (self.bbox.max[1] - self.bbox.min[1])
11811181
scale_z = 1
1182+
1183+
# Limit box zoom to reasonable range, protect for divide by zero below
1184+
scale_x = np.clip(scale_x, 1e-2, 1e2)
1185+
scale_y = np.clip(scale_y, 1e-2, 1e2)
1186+
11821187
if direction == 'out':
11831188
scale_x = 1 / scale_x
11841189
scale_y = 1 / scale_y

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.