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

Skip to content

Commit 44a6d28

Browse files
Code review changes
1 parent 9e60e62 commit 44a6d28

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/users/next_whats_new/3d_plot_pan_zoom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
----------------------------
33

44
The pan and zoom buttons in the toolbar of 3D plots are now enabled.
5-
Deselect both to rotate the plot. When the zoom button is pressed,
5+
Unselect both to rotate the plot. When the zoom button is pressed,
66
zoom in by using the left mouse button to draw a bounding box, and
77
out by using the right mouse button to draw the box. When zooming a
88
3D plot, the current view aspect ratios are kept fixed.

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import matplotlib.transforms as mtransforms
3232
from matplotlib.axes import Axes
3333
from matplotlib.axes._base import _axis_method_wrapper, _process_plot_format
34-
from matplotlib.backend_bases import _Mode
3534
from matplotlib.transforms import Bbox
3635
from matplotlib.tri.triangulation import Triangulation
3736

@@ -1012,7 +1011,9 @@ def _button_press(self, event):
10121011
def _button_release(self, event):
10131012
self.button_pressed = None
10141013
toolbar = getattr(self.figure.canvas, "toolbar")
1015-
if toolbar and toolbar.mode not in (_Mode.PAN, _Mode.ZOOM):
1014+
# backend_bases.release_zoom and backend_bases.release_pan call
1015+
# push_current, so check the navigation mode so we don't call it twice
1016+
if toolbar and self.get_navigate_mode() is None:
10161017
self.figure.canvas.toolbar.push_current()
10171018

10181019
def _get_view(self):
@@ -1162,7 +1163,7 @@ def drag_pan(self, button, key, x, y):
11621163
if du == 0 and dv == 0:
11631164
return
11641165

1165-
# Transform the pan from the view axes to the data axees
1166+
# Transform the pan from the view axes to the data axes
11661167
R = np.array([self._view_u, self._view_v, self._view_w])
11671168
R = -R / self._box_aspect * self._dist
11681169
duvw_projected = R.T @ np.array([du, dv, dw])

0 commit comments

Comments
 (0)