Parameters ---------- line : `~matplotlib.lines.Line2D` The line must already have been added to an `~.axes.Axes` and must have its picker property set.
(self, line)
| 1681 | """ |
| 1682 | |
| 1683 | def __init__(self, line): |
| 1684 | """ |
| 1685 | Parameters |
| 1686 | ---------- |
| 1687 | line : `~matplotlib.lines.Line2D` |
| 1688 | The line must already have been added to an `~.axes.Axes` and must |
| 1689 | have its picker property set. |
| 1690 | """ |
| 1691 | if line.axes is None: |
| 1692 | raise RuntimeError('You must first add the line to the Axes') |
| 1693 | if line.get_picker() is None: |
| 1694 | raise RuntimeError('You must first set the picker property ' |
| 1695 | 'of the line') |
| 1696 | self.axes = line.axes |
| 1697 | self.line = line |
| 1698 | self.cid = self.canvas.callbacks._connect_picklable( |
| 1699 | 'pick_event', self.onpick) |
| 1700 | self.ind = set() |
| 1701 | |
| 1702 | canvas = property(lambda self: self.axes.get_figure(root=True).canvas) |
| 1703 |
nothing calls this directly
no test coverage detected