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

Method contains

lib/matplotlib/table.py:437–451  ·  view source on GitHub ↗
(self, mouseevent)

Source from the content-addressed store, hash-verified

435 return bbox.transformed(self.get_transform().inverted())
436
437 def contains(self, mouseevent):
438 # docstring inherited
439 if self._different_canvas(mouseevent):
440 return False, {}
441 # TODO: Return index of the cell containing the cursor so that the user
442 # doesn't have to bind to each one individually.
443 renderer = self.get_figure(root=True)._get_renderer()
444 if renderer is not None:
445 boxes = [cell.get_window_extent(renderer)
446 for (row, col), cell in self._cells.items()
447 if row >= 0 and col >= 0]
448 bbox = Bbox.union(boxes)
449 return bbox.contains(mouseevent.x, mouseevent.y), {}
450 else:
451 return False, {}
452
453 def get_children(self):
454 """Return the Artists contained by the table."""

Callers

nothing calls this directly

Calls 5

_different_canvasMethod · 0.80
unionMethod · 0.80
_get_rendererMethod · 0.45
get_figureMethod · 0.45
get_window_extentMethod · 0.45

Tested by

no test coverage detected