From 4a910ba9c90575fbf0819abf33c2858b94c5350b Mon Sep 17 00:00:00 2001 From: Federico Ariza Date: Fri, 5 Sep 2014 10:41:10 -0400 Subject: [PATCH] call set cursor on zoom/pan toggle --- lib/matplotlib/backend_bases.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index aa1b76635643..525dbe94652d 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2456,9 +2456,11 @@ def key_press_handler(event, canvas, toolbar=None): # pan mnemonic (default key 'p') elif event.key in pan_keys: toolbar.pan() + toolbar._set_cursor(event) # zoom mnemonic (default key 'o') elif event.key in zoom_keys: toolbar.zoom() + toolbar._set_cursor(event) # saving current figure (default key 's') elif event.key in save_keys: toolbar.save_figure() @@ -2739,7 +2741,7 @@ class implementation. """ raise NotImplementedError - def mouse_move(self, event): + def _set_cursor(self, event): if not event.inaxes or not self._active: if self._lastCursor != cursors.POINTER: self.set_cursor(cursors.POINTER) @@ -2755,6 +2757,9 @@ def mouse_move(self, event): self._lastCursor = cursors.MOVE + def mouse_move(self, event): + self._set_cursor(event) + if event.inaxes and event.inaxes.get_navigate(): try: