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

Method contains

lib/matplotlib/offsetbox.py:241–271  ·  view source on GitHub ↗

Delegate the mouse event contains-check to the children. As a container, the `.OffsetBox` does not respond itself to mouseevents. Parameters ---------- mouseevent : `~matplotlib.backend_bases.MouseEvent` Returns ------- cont

(self, mouseevent)

Source from the content-addressed store, hash-verified

239 c.axes = ax
240
241 def contains(self, mouseevent):
242 """
243 Delegate the mouse event contains-check to the children.
244
245 As a container, the `.OffsetBox` does not respond itself to
246 mouseevents.
247
248 Parameters
249 ----------
250 mouseevent : `~matplotlib.backend_bases.MouseEvent`
251
252 Returns
253 -------
254 contains : bool
255 Whether any values are within the radius.
256 details : dict
257 An artist-specific dictionary of details of the event context,
258 such as which points are contained in the pick radius. See the
259 individual Artist subclasses for details.
260
261 See Also
262 --------
263 .Artist.contains
264 """
265 if self._different_canvas(mouseevent):
266 return False, {}
267 for c in self.get_children():
268 a, b = c.contains(mouseevent)
269 if a:
270 return a, b
271 return False, {}
272
273 def set_offset(self, xy):
274 """

Callers 2

containsMethod · 0.45
_pickerMethod · 0.45

Calls 2

get_childrenMethod · 0.95
_different_canvasMethod · 0.80

Tested by

no test coverage detected