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

Method _mouse_move

lib/matplotlib/backend_tools.py:766–779  ·  view source on GitHub ↗

Callback for mouse moves in zoom-to-rectangle mode.

(self, event)

Source from the content-addressed store, hash-verified

764 self._mouse_move(event)
765
766 def _mouse_move(self, event):
767 """Callback for mouse moves in zoom-to-rectangle mode."""
768
769 if self._xypress:
770 x, y = event.x, event.y
771 lastx, lasty, a, ind, view = self._xypress[0]
772 (x1, y1), (x2, y2) = np.clip(
773 [[lastx, lasty], [x, y]], a.bbox.min, a.bbox.max)
774 if self._zoom_mode == "x":
775 y1, y2 = a.bbox.intervaly
776 elif self._zoom_mode == "y":
777 x1, x2 = a.bbox.intervalx
778 self.toolmanager.trigger_tool(
779 'rubberband', self, data=(x1, y1, x2, y2))
780
781 def _release(self, event):
782 """Callback for mouse button releases in zoom-to-rectangle mode."""

Callers 2

_switch_on_zoom_modeMethod · 0.95
_switch_off_zoom_modeMethod · 0.95

Calls 2

clipMethod · 0.45
trigger_toolMethod · 0.45

Tested by

no test coverage detected