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 88d616f

Browse filesBrowse files
Handle x/y lock when zooming and panning
1 parent bb95903 commit 88d616f
Copy full SHA for 88d616f

File tree

Expand file treeCollapse file tree

1 file changed

+13
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-2
lines changed

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,9 +1101,13 @@ def drag_pan(self, button, key, x, y):
11011101
# move location for the next event
11021102
self.start_pan(x, y, button)
11031103
dx, dy = xdata - xdata_start, ydata - ydata_start
1104+
dz = 0
1105+
if key == 'x':
1106+
dy = 0
1107+
elif key == 'y':
1108+
dx = 0
11041109
if dx == 0 and dy == 0:
11051110
return
1106-
dz = 0
11071111

11081112
# Transform the pan from the view axes to the data axees
11091113
u, v, n = self._get_view_axes(self.eye)
@@ -1139,8 +1143,15 @@ def _get_view_axes(self, eye):
11391143

11401144
def _set_view_from_bbox(self, bbox, direction='in',
11411145
mode=None, twinx=False, twiny=False):
1142-
# Move the center of the view to the center of the bbox
11431146
(start_x, start_y, stop_x, stop_y) = self._prepare_view_from_bbox(bbox)
1147+
if mode == 'x':
1148+
start_y = self.bbox.min[1]
1149+
stop_y = self.bbox.max[1]
1150+
elif mode == 'y':
1151+
start_x = self.bbox.min[0]
1152+
stop_x = self.bbox.max[0]
1153+
1154+
# Move the center of the view to the center of the bbox
11441155
zoom_center_x = (start_x + stop_x)/2
11451156
zoom_center_y = (start_y + stop_y)/2
11461157

0 commit comments

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