Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 16f6370 + 339c630 commit 853312bCopy full SHA for 853312b
1 file changed
lib/matplotlib/backend_tools.py
@@ -821,7 +821,7 @@ def _release(self, event):
821
self._cancel_action()
822
return
823
824
- last_a = []
+ done_ax = []
825
826
for cur_xypress in self._xypress:
827
x, y = event.x, event.y
@@ -832,14 +832,9 @@ def _release(self, event):
832
833
834
# detect twinx, twiny axes and avoid double zooming
835
- twinx, twiny = False, False
836
- if last_a:
837
- for la in last_a:
838
- if a.get_shared_x_axes().joined(a, la):
839
- twinx = True
840
- if a.get_shared_y_axes().joined(a, la):
841
- twiny = True
842
- last_a.append(a)
+ twinx = any(a.get_shared_x_axes().joined(a, a1) for a1 in done_ax)
+ twiny = any(a.get_shared_y_axes().joined(a, a1) for a1 in done_ax)
+ done_ax.append(a)
843
844
if self._button_pressed == 1:
845
direction = 'in'
0 commit comments