MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _press

Method _press

lib/matplotlib/backend_tools.py:842–861  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

840 self.figure.canvas.draw_idle()
841
842 def _press(self, event):
843 if event.button == 1:
844 self._button_pressed = 1
845 elif event.button == 3:
846 self._button_pressed = 3
847 else:
848 self._cancel_action()
849 return
850
851 x, y = event.x, event.y
852
853 self._xypress = []
854 for i, a in enumerate(self.figure.get_axes()):
855 if (x is not None and y is not None and a.in_axes(event) and
856 a.get_navigate() and a.can_pan()):
857 a.start_pan(x, y, event.button)
858 self._xypress.append((a, i))
859 self.toolmanager.messagelock(self)
860 self._id_drag = self.figure.canvas.mpl_connect(
861 'motion_notify_event', self._mouse_move)
862
863 def _release(self, event):
864 if self._button_pressed is None:

Callers

nothing calls this directly

Calls 6

_cancel_actionMethod · 0.95
in_axesMethod · 0.80
get_navigateMethod · 0.80
mpl_connectMethod · 0.80
can_panMethod · 0.45
start_panMethod · 0.45

Tested by

no test coverage detected