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

Method __init__

lib/matplotlib/backend_bases.py:1279–1297  ·  view source on GitHub ↗
(self, name, canvas, x, y, guiEvent=None, *, modifiers=None)

Source from the content-addressed store, hash-verified

1277 _last_axes_ref = None
1278
1279 def __init__(self, name, canvas, x, y, guiEvent=None, *, modifiers=None):
1280 super().__init__(name, canvas, guiEvent=guiEvent)
1281 # x position - pixels from left of canvas
1282 self.x = int(x) if x is not None else x
1283 # y position - pixels from right of canvas
1284 self.y = int(y) if y is not None else y
1285 self.inaxes = None # the Axes instance the mouse is over
1286 self.xdata = None # x coord of mouse in data coords
1287 self.ydata = None # y coord of mouse in data coords
1288 self.modifiers = frozenset(modifiers if modifiers is not None else [])
1289
1290 if x is None or y is None:
1291 # cannot check if event was in Axes if no (x, y) info
1292 return
1293
1294 self._set_inaxes(self.canvas.inaxes((x, y))
1295 if self.canvas.mouse_grabber is None else
1296 self.canvas.mouse_grabber,
1297 (x, y))
1298
1299 # Splitting _set_inaxes out is useful for the axes_leave_event handler: it
1300 # needs to generate synthetic LocationEvents with manually-set inaxes. In

Callers

nothing calls this directly

Calls 3

_set_inaxesMethod · 0.95
inaxesMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected