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

Method __init__

lib/matplotlib/widgets.py:4408–4426  ·  view source on GitHub ↗
(self, ax, xy, callback, *, useblit=True, props=None)

Source from the content-addressed store, hash-verified

4406 .. versionadded:: 3.9
4407 """
4408 def __init__(self, ax, xy, callback, *, useblit=True, props=None):
4409 super().__init__(ax)
4410
4411 self.useblit = useblit and self.canvas.supports_blit # TODO: Make dynamic
4412 if self.useblit:
4413 self.background = self.canvas.copy_from_bbox(self.ax.bbox)
4414
4415 style = {'linestyle': '-', 'color': 'black', 'lw': 2}
4416
4417 if props is not None:
4418 style.update(props)
4419
4420 x, y = xy
4421 self.verts = [(x, y)]
4422 self.line = Line2D([x], [y], **style)
4423 self.ax.add_line(self.line)
4424 self.callback = callback
4425 self.connect_event('button_release_event', self.onrelease)
4426 self.connect_event('motion_notify_event', self.onmove)
4427
4428 @_call_with_reparented_event
4429 def onrelease(self, event):

Callers 14

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 5

Line2DClass · 0.85
add_lineMethod · 0.80
connect_eventMethod · 0.80
copy_from_bboxMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected