@@ -2512,11 +2512,13 @@ def press_pan(self, event):
25122512
25132513 self ._xypress = []
25142514 for i , a in enumerate (self .canvas .figure .get_axes ()):
2515- if x is not None and y is not None and a .in_axes (event ) and a .get_navigate ():
2515+ if (x is not None and y is not None and a .in_axes (event ) and
2516+ a .get_navigate () and a .can_pan ()) :
25162517 a .start_pan (x , y , event .button )
25172518 self ._xypress .append ((a , i ))
25182519 self .canvas .mpl_disconnect (self ._idDrag )
2519- self ._idDrag = self .canvas .mpl_connect ('motion_notify_event' , self .drag_pan )
2520+ self ._idDrag = self .canvas .mpl_connect ('motion_notify_event' ,
2521+ self .drag_pan )
25202522
25212523 self .press (event )
25222524
@@ -2537,9 +2539,10 @@ def press_zoom(self, event):
25372539
25382540 self ._xypress = []
25392541 for i , a in enumerate (self .canvas .figure .get_axes ()):
2540- if x is not None and y is not None and a .in_axes (event ) \
2541- and a .get_navigate () and a .can_zoom ():
2542- self ._xypress .append (( x , y , a , i , a .viewLim .frozen (), a .transData .frozen ()))
2542+ if (x is not None and y is not None and a .in_axes (event ) and
2543+ a .get_navigate () and a .can_zoom ()) :
2544+ self ._xypress .append (( x , y , a , i , a .viewLim .frozen (),
2545+ a .transData .frozen () ))
25432546
25442547 id1 = self .canvas .mpl_connect ('motion_notify_event' , self .drag_zoom )
25452548
0 commit comments