1
1
"""
2
- The 2D line class which can draw with a variety of line styles, markers and
3
- colors.
2
+ 2D lines with support for a variety of line styles, markers, colors, etc.
4
3
"""
5
4
6
5
from numbers import Integral , Number , Real
@@ -715,26 +714,16 @@ def _transform_path(self, subslice=None):
715
714
self ._transformed_path = TransformedPath (_path , self .get_transform ())
716
715
717
716
def _get_transformed_path (self ):
718
- """
719
- Return the :class:`~matplotlib.transforms.TransformedPath` instance
720
- of this line.
721
- """
717
+ """Return this line's `~matplotlib.transforms.TransformedPath`."""
722
718
if self ._transformed_path is None :
723
719
self ._transform_path ()
724
720
return self ._transformed_path
725
721
726
722
def set_transform (self , t ):
727
- """
728
- Set the Transformation instance used by this artist.
729
-
730
- Parameters
731
- ----------
732
- t : `matplotlib.transforms.Transform`
733
- """
734
- super ().set_transform (t )
723
+ # docstring inherited
735
724
self ._invalidx = True
736
725
self ._invalidy = True
737
- self . stale = True
726
+ super (). set_transform ( t )
738
727
739
728
def _is_sorted (self , x ):
740
729
"""Return whether x is sorted in ascending order."""
@@ -1014,10 +1003,7 @@ def get_ydata(self, orig=True):
1014
1003
return self ._y
1015
1004
1016
1005
def get_path (self ):
1017
- """
1018
- Return the :class:`~matplotlib.path.Path` object associated
1019
- with this line.
1020
- """
1006
+ """Return the `~matplotlib.path.Path` associated with this line."""
1021
1007
if self ._invalidy or self ._invalidx :
1022
1008
self .recache ()
1023
1009
return self ._path
@@ -1477,9 +1463,8 @@ def draw(self, renderer):
1477
1463
1478
1464
class VertexSelector :
1479
1465
"""
1480
- Manage the callbacks to maintain a list of selected vertices for
1481
- `.Line2D`. Derived classes should override
1482
- :meth:`~matplotlib.lines.VertexSelector.process_selected` to do
1466
+ Manage the callbacks to maintain a list of selected vertices for `.Line2D`.
1467
+ Derived classes should override the `process_selected` method to do
1483
1468
something with the picks.
1484
1469
1485
1470
Here is an example which highlights the selected verts with red
@@ -1508,9 +1493,8 @@ def process_selected(self, ind, xs, ys):
1508
1493
"""
1509
1494
def __init__ (self , line ):
1510
1495
"""
1511
- Initialize the class with a `.Line2D` instance. The line should
1512
- already be added to some :class:`matplotlib.axes.Axes` instance and
1513
- should have the picker property set.
1496
+ Initialize the class with a `.Line2D`. The line should already be
1497
+ added to an `~.axes.Axes` and should have the picker property set.
1514
1498
"""
1515
1499
if line .axes is None :
1516
1500
raise RuntimeError ('You must first add the line to the Axes' )
@@ -1528,8 +1512,7 @@ def __init__(self, line):
1528
1512
1529
1513
def process_selected (self , ind , xs , ys ):
1530
1514
"""
1531
- Default "do nothing" implementation of the
1532
- :meth:`process_selected` method.
1515
+ Default "do nothing" implementation of the `process_selected` method.
1533
1516
1534
1517
Parameters
1535
1518
----------
@@ -1556,7 +1539,4 @@ def onpick(self, event):
1556
1539
fillStyles = MarkerStyle .fillstyles
1557
1540
1558
1541
docstring .interpd .update (Line2D_kwdoc = artist .kwdoc (Line2D ))
1559
-
1560
- # You can not set the docstring of an instancemethod,
1561
- # but you can on the underlying function. Go figure.
1562
1542
docstring .interpd (Line2D .__init__ )
0 commit comments