def _interactive_zoom_press(self, event):
"""
Right-mouse button pressed in axis.
:param event:
A matplotlib event.
"""
if event.button != 3 or event.inaxes is None:
return None
self._interactive_zoom_initial_bounds = [event.xdata, event.ydata]
self._interactive_zoom_axis_index = self.figure.axes.index(event.inaxes)
# Create lines if needed
if self._interactive_zoom_axis_index not in self._right_click_zoom_box:
self._right_click_zoom_box[self._interactive_zoom_axis_index] \
= event.inaxes.plot([np.nan], [np.nan], "k:")[0]
# Create zoom box signal
self._interactive_zoom_box_signal = (
time.time(),
self.mpl_connect("motion_notify_event", self._update_interactive_zoom)
)
return None
评论列表
文章目录