@@ -93,21 +93,17 @@ def __init__(self,
93
93
** kwargs
94
94
):
95
95
"""
96
- For all "plural" parameters, the type listed is the expected type when
97
- passing a single value to be used for the whole collection. For any of
98
- these inputs, a Sequence of the specified type is also allowed.
99
-
100
96
Parameters
101
97
----------
102
- edgecolors : color, default: :rc:`patch.edgecolor`
98
+ edgecolors : color or list of colors , default: :rc:`patch.edgecolor`
103
99
Edge color for each patch making up the collection. The special
104
100
value 'face' can be passed to make the edgecolor match the
105
101
facecolor.
106
- facecolors : color, default: :rc:`patch.facecolor`
102
+ facecolors : color or list of colors , default: :rc:`patch.facecolor`
107
103
Face color for each patch making up the collection.
108
- linewidths : float, default: :rc:`patch.linewidth`
104
+ linewidths : float or list of floats , default: :rc:`patch.linewidth`
109
105
Line width for each patch making up the collection.
110
- linestyles : str or tuple, default: 'solid'
106
+ linestyles : str or tuple or list thereof , default: 'solid'
111
107
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-',
112
108
'--', '-.', ':']. Dash tuples should be of the form::
113
109
@@ -120,10 +116,10 @@ def __init__(self,
120
116
Style to use for capping lines for all paths in the collection.
121
117
joinstyle : str, default: :rc:`patch.joinstyle`
122
118
Style to use for joining lines for all paths in the collection.
123
- antialiaseds : bool, default: :rc:`patch.antialiased`
119
+ antialiaseds : bool or list of bool , default: :rc:`patch.antialiased`
124
120
Whether each pach in the collection should be drawn with
125
121
antialiasing.
126
- offsets : (float, float), default: (0, 0)
122
+ offsets : (float, float) or list thereof , default: (0, 0)
127
123
A vector by which to translate each patch after rendering (default
128
124
is no translation). The translation is performed in screen (pixel)
129
125
coordinates (i.e. after the Artist's transform is applied).
@@ -152,7 +148,7 @@ def __init__(self,
152
148
other hand, if it is greater than 0, then we instead check if the
153
149
test point is contained in a stroke of width ``2*pickradius``
154
150
following any of the Paths in the Collection.
155
- urls : str, default: None
151
+ urls : list of str, optional , default: None
156
152
A URL for each patch to link to once drawn. Currently only works
157
153
for the SVG backend. See :doc:`/gallery/misc/hyperlinks_sgskip` for
158
154
examples.
@@ -472,7 +468,7 @@ def set_urls(self, urls):
472
468
"""
473
469
Parameters
474
470
----------
475
- urls : list of str or None
471
+ urls : sequence of str or None
476
472
477
473
Notes
478
474
-----
@@ -594,7 +590,7 @@ def set_linewidth(self, lw):
594
590
595
591
Parameters
596
592
----------
597
- lw : float or sequence of floats
593
+ lw : float or list of floats
598
594
"""
599
595
if lw is None :
600
596
lw = mpl .rcParams ['patch.linewidth' ]
@@ -629,8 +625,11 @@ def set_linestyle(self, ls):
629
625
630
626
Parameters
631
627
----------
632
- ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
633
- The line style.
628
+ ls : str or tuple or list thereof
629
+ Valid values for individual linestyles include {'-', '--', '-.',
630
+ ':', '', (offset, on-off-seq)}. See
631
+ `~.matplotlib.lines.Line2D.set_linestyle` for a complete
632
+ description.
634
633
"""
635
634
try :
636
635
if isinstance (ls , str ):
@@ -660,7 +659,7 @@ def set_capstyle(self, cs):
660
659
Parameters
661
660
----------
662
661
cs : {'butt', 'round', 'projecting'}
663
- The capstyle
662
+ The capstyle.
664
663
"""
665
664
mpl .rcsetup .validate_capstyle (cs )
666
665
self ._capstyle = cs
@@ -675,7 +674,7 @@ def set_joinstyle(self, js):
675
674
Parameters
676
675
----------
677
676
js : {'miter', 'round', 'bevel'}
678
- The joinstyle
677
+ The joinstyle.
679
678
"""
680
679
mpl .rcsetup .validate_joinstyle (js )
681
680
self ._joinstyle = js
@@ -1019,9 +1018,10 @@ def legend_elements(self, prop="colors", num="auto",
1019
1018
1020
1019
Returns
1021
1020
-------
1022
- tuple (handles, labels)
1023
- with *handles* being a list of `.Line2D` objects
1024
- and *labels* a matching list of strings.
1021
+ handles : list of `.Line2D`
1022
+ Visual representation of each element of the legend.
1023
+ labels : list of str
1024
+ The string label for element of the legend.
1025
1025
"""
1026
1026
handles = []
1027
1027
labels = []
@@ -1102,11 +1102,11 @@ def __init__(self, verts, sizes=None, closed=True, **kwargs):
1102
1102
"""
1103
1103
Parameters
1104
1104
----------
1105
- verts : sequence
1105
+ verts : sequence of array-like
1106
1106
The sequence of polygons [*verts0*, *verts1*, ...] where each
1107
1107
element *verts_i* defines the vertices of polygon *i* as a 2D
1108
1108
array-like of of shape (M, 2).
1109
- sizes : array-like, default: None
1109
+ sizes : array-like of float , default: None
1110
1110
Squared scaling factors for the polygons. The coordinates of each
1111
1111
polygon *verts_i* are multiplied by the square-root of the
1112
1112
corresponding entry in *sizes* (i.e., *sizes* specify the scaling
@@ -1302,11 +1302,21 @@ class AsteriskPolygonCollection(RegularPolyCollection):
1302
1302
1303
1303
1304
1304
class LineCollection (Collection ):
1305
- """
1306
- Collection of 2D lines. Each line may have an arbitrary number of segments.
1305
+ r"""
1306
+ Represents a sequence of `~.lines.Line2D`\s that should be drawn together.
1307
+
1308
+ This class extends `.Collection` to represent a sequence of
1309
+ `~.lines.Line2D`\s instead of just a sequence of `~.patches.Patch`\s.
1310
+ Just as in `.Collection`, each property of a *LineCollection* may be either
1311
+ a single value or a list of values. This list is then used cyclically for
1312
+ each element of the LineCollection, so the property of the ``i``\th element
1313
+ of the collection is::
1307
1314
1308
- Relevant parameters default to their ``'lines'`` values in
1309
- `~.matplotlib.rcParams` instead of their ``'patch'`` values.
1315
+ prop[i % len(prop)]
1316
+
1317
+ A *LineCollection*'s properties default to their ``'lines'`` values in
1318
+ `~.matplotlib.rcParams` instead of their ``'patch'`` values, and the
1319
+ property *colors* is added in place of *edgecolors*.
1310
1320
"""
1311
1321
1312
1322
_edge_default = True
@@ -1326,32 +1336,25 @@ def __init__(self, segments, # Can be None.
1326
1336
** kwargs
1327
1337
):
1328
1338
"""
1329
- Except for *segments*, the type listed below is the expected type when
1330
- passing a single value to be used for the whole collection. A Sequence
1331
- of the specified type is also allowed, in which case the property for
1332
- the ``i``th element of the collection will be::
1333
-
1334
- prop[i % len(prop)]
1335
-
1336
1339
Parameters
1337
1340
----------
1338
- segments
1341
+ segments: sequence of array-like
1339
1342
A sequence of (*line0*, *line1*, *line2*), where::
1340
1343
1341
1344
linen = (x0, y0), (x1, y1), ... (xm, ym)
1342
1345
1343
1346
or the equivalent numpy array with two columns. Each line
1344
1347
can have a different number of segments.
1345
- linewidths : float, default: :rc:`lines.linewidth`
1348
+ linewidths : float or list of float , default: :rc:`lines.linewidth`
1346
1349
The width of each line in points.
1347
- colors : color, default: :rc:`lines.color`
1350
+ colors : color or list of color , default: :rc:`lines.color`
1348
1351
A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not
1349
1352
allowed).
1350
- antialiaseds : default: :rc:`lines.antialiased`
1353
+ antialiaseds : bool or list of bool, default: :rc:`lines.antialiased`
1351
1354
Whether to use antialiasing for each line.
1352
1355
zorder : int, default: 2
1353
1356
zorder of the lines once drawn.
1354
- facecolors : default: 'none'
1357
+ facecolors : color or list of color, default: 'none'
1355
1358
The facecolors of the LineCollection.
1356
1359
Setting to a value other than 'none' will lead to each line being
1357
1360
"filled in" as if there was an implicit line segment joining the
@@ -1492,19 +1495,19 @@ def __init__(self,
1492
1495
linelength : float, default: 1
1493
1496
The total height of the marker (i.e. the marker stretches from
1494
1497
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
1495
- linewidth : float, default: :rc:`lines.linewidth`
1498
+ linewidth : float or list thereof , default: :rc:`lines.linewidth`
1496
1499
The line width of the event lines, in points.
1497
1500
color : color or list of colors, default: :rc:`lines.color`
1498
1501
The color of the event lines.
1499
- linestyle : str or tuple, default: 'solid'
1502
+ linestyle : str or tuple or list thereof , default: 'solid'
1500
1503
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
1501
1504
'-', '--', '-.', ':']. Dash tuples should be of the form::
1502
1505
1503
1506
(offset, onoffseq),
1504
1507
1505
1508
where *onoffseq* is an even length tuple of on and off ink
1506
1509
in points.
1507
- antialiased : bool, default: :rc:`lines.antialiased`
1510
+ antialiased : bool or list thereof , default: :rc:`lines.antialiased`
1508
1511
Whether to use antialiasing for drawing the lines.
1509
1512
**kwargs
1510
1513
Forwarded to `.LineCollection`.
0 commit comments