diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 1203862a3f50..0b7ff7600eb3 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -1,6 +1,5 @@ """ -The 2D line class which can draw with a variety of line styles, markers and -colors. +2D lines with support for a variety of line styles, markers, colors, etc. """ from numbers import Integral, Number, Real @@ -715,26 +714,16 @@ def _transform_path(self, subslice=None): self._transformed_path = TransformedPath(_path, self.get_transform()) def _get_transformed_path(self): - """ - Return the :class:`~matplotlib.transforms.TransformedPath` instance - of this line. - """ + """Return this line's `~matplotlib.transforms.TransformedPath`.""" if self._transformed_path is None: self._transform_path() return self._transformed_path def set_transform(self, t): - """ - Set the Transformation instance used by this artist. - - Parameters - ---------- - t : `matplotlib.transforms.Transform` - """ - super().set_transform(t) + # docstring inherited self._invalidx = True self._invalidy = True - self.stale = True + super().set_transform(t) def _is_sorted(self, x): """Return whether x is sorted in ascending order.""" @@ -1014,10 +1003,7 @@ def get_ydata(self, orig=True): return self._y def get_path(self): - """ - Return the :class:`~matplotlib.path.Path` object associated - with this line. - """ + """Return the `~matplotlib.path.Path` associated with this line.""" if self._invalidy or self._invalidx: self.recache() return self._path @@ -1477,9 +1463,8 @@ def draw(self, renderer): class VertexSelector: """ - Manage the callbacks to maintain a list of selected vertices for - `.Line2D`. Derived classes should override - :meth:`~matplotlib.lines.VertexSelector.process_selected` to do + Manage the callbacks to maintain a list of selected vertices for `.Line2D`. + Derived classes should override the `process_selected` method to do something with the picks. Here is an example which highlights the selected verts with red @@ -1508,9 +1493,8 @@ def process_selected(self, ind, xs, ys): """ def __init__(self, line): """ - Initialize the class with a `.Line2D` instance. The line should - already be added to some :class:`matplotlib.axes.Axes` instance and - should have the picker property set. + Initialize the class with a `.Line2D`. The line should already be + added to an `~.axes.Axes` and should have the picker property set. """ if line.axes is None: raise RuntimeError('You must first add the line to the Axes') @@ -1528,8 +1512,7 @@ def __init__(self, line): def process_selected(self, ind, xs, ys): """ - Default "do nothing" implementation of the - :meth:`process_selected` method. + Default "do nothing" implementation of the `process_selected` method. Parameters ---------- @@ -1556,7 +1539,4 @@ def onpick(self, event): fillStyles = MarkerStyle.fillstyles docstring.interpd.update(Line2D_kwdoc=artist.kwdoc(Line2D)) - -# You can not set the docstring of an instancemethod, -# but you can on the underlying function. Go figure. docstring.interpd(Line2D.__init__)