|
5 | 5 |
|
6 | 6 | Plotting lines with Matplotlib.
|
7 | 7 |
|
8 |
| -:class:`~matplotlib.collections.LineCollection` allows one to plot multiple |
| 8 | +`~matplotlib.collections.LineCollection` allows one to plot multiple |
9 | 9 | lines on a figure. Below we show off some of its properties.
|
10 | 10 | """
|
| 11 | + |
11 | 12 | import matplotlib.pyplot as plt
|
12 | 13 | from matplotlib.collections import LineCollection
|
13 | 14 | from matplotlib import colors as mcolors
|
|
34 | 35 | ax.set_xlim(x.min(), x.max())
|
35 | 36 | ax.set_ylim(ys.min(), ys.max())
|
36 | 37 |
|
37 |
| -# colors is sequence of rgba tuples |
38 |
| -# linestyle is a string or dash tuple. Legal string values are |
39 |
| -# solid|dashed|dashdot|dotted. The dash tuple is (offset, onoffseq) |
40 |
| -# where onoffseq is an even length tuple of on and off ink in points. |
41 |
| -# If linestyle is omitted, 'solid' is used |
42 |
| -# See :class:`matplotlib.collections.LineCollection` for more information |
| 38 | +# *colors* is sequence of rgba tuples. |
| 39 | +# *linestyle* is a string or dash tuple. Legal string values are |
| 40 | +# solid|dashed|dashdot|dotted. The dash tuple is (offset, onoffseq) where |
| 41 | +# onoffseq is an even length tuple of on and off ink in points. If linestyle |
| 42 | +# is omitted, 'solid' is used. |
| 43 | +# See `matplotlib.collections.LineCollection` for more information. |
43 | 44 | colors = [mcolors.to_rgba(c)
|
44 | 45 | for c in plt.rcParams['axes.prop_cycle'].by_key()['color']]
|
45 | 46 |
|
|
69 | 70 | # solid|dashed|dashdot|dotted. The dash tuple is (offset, onoffseq)
|
70 | 71 | # where onoffseq is an even length tuple of on and off ink in points.
|
71 | 72 | # If linestyle is omitted, 'solid' is used
|
72 |
| -# See :class:`matplotlib.collections.LineCollection` for more information |
| 73 | +# See `matplotlib.collections.LineCollection` for more information |
73 | 74 |
|
74 | 75 | # Make a sequence of (x, y) pairs.
|
75 | 76 | line_segments = LineCollection([np.column_stack([x, y]) for y in ys],
|
|
0 commit comments