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

Method _clean_event

lib/matplotlib/widgets.py:2465–2480  ·  view source on GitHub ↗

Preprocess an event: - Replace *event* by the previous event if *event* has no ``xdata``. - Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes limits. - Update the previous event.

(self, event)

Source from the content-addressed store, hash-verified

2463 return xdata, ydata
2464
2465 def _clean_event(self, event):
2466 """
2467 Preprocess an event:
2468
2469 - Replace *event* by the previous event if *event* has no ``xdata``.
2470 - Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes
2471 limits.
2472 - Update the previous event.
2473 """
2474 if event.xdata is None:
2475 event = self._prev_event
2476 else:
2477 event = copy.copy(event)
2478 event.xdata, event.ydata = self._get_data(event)
2479 self._prev_event = event
2480 return event
2481
2482 @_call_with_reparented_event
2483 def press(self, event):

Callers 5

pressMethod · 0.95
releaseMethod · 0.95
onmoveMethod · 0.95
onmoveMethod · 0.80
_on_key_releaseMethod · 0.80

Calls 2

_get_dataMethod · 0.95
copyMethod · 0.45

Tested by

no test coverage detected