Set the linestyle(s) for the collection. Parameters ---------- ls : {'-', '--', '-.', ':', '', ...} or (offset, on-off-seq) or list thereof If a list, the individual elements are assigned to the elements of the collection. Possib
(self, ls)
| 670 | self.stale = True |
| 671 | |
| 672 | def set_linestyle(self, ls): |
| 673 | """ |
| 674 | Set the linestyle(s) for the collection. |
| 675 | |
| 676 | Parameters |
| 677 | ---------- |
| 678 | ls : {'-', '--', '-.', ':', '', ...} or (offset, on-off-seq) or list thereof |
| 679 | If a list, the individual elements are assigned to the elements of the |
| 680 | collection. |
| 681 | |
| 682 | Possible values: |
| 683 | |
| 684 | - A string: |
| 685 | |
| 686 | ======================================================= ================ |
| 687 | linestyle description |
| 688 | ======================================================= ================ |
| 689 | ``'-'`` or ``'solid'`` solid line |
| 690 | ``'--'`` or ``'dashed'`` dashed line |
| 691 | ``'-.'`` or ``'dashdot'`` dash-dotted line |
| 692 | ``':'`` or ``'dotted'`` dotted line |
| 693 | ``''`` or ``'none'`` (discouraged: ``'None'``, ``' '``) draw nothing |
| 694 | ======================================================= ================ |
| 695 | |
| 696 | - A tuple describing the start position and lengths of dashes and spaces: |
| 697 | |
| 698 | (offset, onoffseq) |
| 699 | |
| 700 | where |
| 701 | |
| 702 | - *offset* is a float specifying the offset (in points); i.e. how much |
| 703 | is the dash pattern shifted. |
| 704 | - *onoffseq* is a sequence of on and off ink in points. There can be |
| 705 | arbitrary many pairs of on and off values. |
| 706 | |
| 707 | Example: The tuple ``(0, (10, 5, 1, 5))`` means that the pattern starts |
| 708 | at the beginning of the line. It draws a 10 point long dash, |
| 709 | then a 5 point long space, then a 1 point long dash, followed by a 5 point |
| 710 | long space, and then the pattern repeats. |
| 711 | |
| 712 | For examples see :doc:`/gallery/lines_bars_and_markers/linestyles`. |
| 713 | """ |
| 714 | # get the list of raw 'unscaled' dash patterns |
| 715 | self._us_linestyles = mlines._get_dash_patterns(ls) |
| 716 | |
| 717 | # broadcast and scale the lw and dash patterns |
| 718 | self._linewidths, self._linestyles = self._bcast_lwls( |
| 719 | self._us_lw, self._us_linestyles) |
| 720 | |
| 721 | @_docstring.interpd |
| 722 | def set_capstyle(self, cs): |