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

Method contains

lib/matplotlib/image.py:1494–1500  ·  view source on GitHub ↗

Test whether the mouse event occurred within the image.

(self, mouseevent)

Source from the content-addressed store, hash-verified

1492 raise ValueError("Unknown type of bbox")
1493
1494 def contains(self, mouseevent):
1495 """Test whether the mouse event occurred within the image."""
1496 if self._different_canvas(mouseevent) or not self.get_visible():
1497 return False, {}
1498 x, y = mouseevent.x, mouseevent.y
1499 inside = self.get_window_extent().contains(x, y)
1500 return inside, {}
1501
1502 def make_image(self, renderer, magnification=1.0, unsampled=False):
1503 # docstring inherited

Callers 1

containsMethod · 0.45

Calls 3

get_window_extentMethod · 0.95
_different_canvasMethod · 0.80
get_visibleMethod · 0.45

Tested by

no test coverage detected