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 b0259b3 + fcfd408 commit ddf2c57Copy full SHA for ddf2c57
lib/matplotlib/backend_bases.py
@@ -2863,6 +2863,18 @@ def press_pan(self, event):
2863
2864
def press_zoom(self, event):
2865
"""the press mouse button in zoom to rect mode callback"""
2866
+ # If we're already in the middle of a zoom, pressing another
2867
+ # button works to "cancel"
2868
+ if self._ids_zoom != []:
2869
+ for zoom_id in self._ids_zoom:
2870
+ self.canvas.mpl_disconnect(zoom_id)
2871
+ self.release(event)
2872
+ self.draw()
2873
+ self._xypress = None
2874
+ self._button_pressed = None
2875
+ self._ids_zoom = []
2876
+ return
2877
+
2878
if event.button == 1:
2879
self._button_pressed = 1
2880
elif event.button == 3:
0 commit comments