|
31 | 31 | import matplotlib.transforms as mtransforms
|
32 | 32 | from matplotlib.axes import Axes
|
33 | 33 | from matplotlib.axes._base import _axis_method_wrapper, _process_plot_format
|
| 34 | +from matplotlib.backend_bases import _Mode |
34 | 35 | from matplotlib.transforms import Bbox
|
35 | 36 | from matplotlib.tri.triangulation import Triangulation
|
36 | 37 |
|
@@ -1011,7 +1012,7 @@ def _button_press(self, event):
|
1011 | 1012 | def _button_release(self, event):
|
1012 | 1013 | self.button_pressed = None
|
1013 | 1014 | toolbar = getattr(self.figure.canvas, "toolbar")
|
1014 |
| - if toolbar: |
| 1015 | + if toolbar and toolbar.mode not in (_Mode.PAN, _Mode.ZOOM): |
1015 | 1016 | self.figure.canvas.toolbar.push_current()
|
1016 | 1017 |
|
1017 | 1018 | def _get_view(self):
|
@@ -1231,10 +1232,6 @@ def _set_view_from_bbox(self, bbox, direction='in',
|
1231 | 1232 | scale_u = dx / (self.bbox.max[0] - self.bbox.min[0])
|
1232 | 1233 | scale_v = dy / (self.bbox.max[1] - self.bbox.min[1])
|
1233 | 1234 |
|
1234 |
| - # Limit box zoom to reasonable range, protect for divide by zero below |
1235 |
| - scale_u = np.clip(scale_u, 1e-2, 1) |
1236 |
| - scale_v = np.clip(scale_v, 1e-2, 1) |
1237 |
| - |
1238 | 1235 | # Keep aspect ratios equal
|
1239 | 1236 | scale = max(scale_u, scale_v)
|
1240 | 1237 |
|
|
0 commit comments