@@ -79,7 +79,7 @@ def __init__(self,
7979 edgecolors = None ,
8080 facecolors = None ,
8181 linewidths = None ,
82- linestyles = 'solid ' ,
82+ linestyles = '- ' ,
8383 capstyle = None ,
8484 joinstyle = None ,
8585 antialiaseds = None ,
@@ -105,15 +105,8 @@ def __init__(self,
105105 Face color for each patch making up the collection.
106106 linewidths : float or list of floats, default: :rc:`patch.linewidth`
107107 Line width for each patch making up the collection.
108- linestyles : str or tuple or list thereof, default: 'solid'
109- Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-',
110- '--', '-.', ':']. Dash tuples should be of the form::
111-
112- (offset, onoffseq),
113-
114- where *onoffseq* is an even length tuple of on and off ink lengths
115- in points. For examples, see
116- :doc:`/gallery/lines_bars_and_markers/linestyles`.
108+ linestyles : str or tuple or list thereof, default: '-'
109+ Line style or list of line styles. See `set_linestyle` for details.
117110 capstyle : `.CapStyle`-like, default: :rc:`patch.capstyle`
118111 Style to use for capping lines for all paths in the collection.
119112 Allowed values are %(CapStyle)s.
@@ -584,43 +577,51 @@ def set_linewidth(self, lw):
584577
585578 def set_linestyle (self , ls ):
586579 """
587- Set the linestyle (s) for the collection.
580+ Set the line style (s) for the collection.
588581
589- =========================== =================
590- linestyle description
591- =========================== =================
592- ``'-'`` or ``'solid'`` solid line
593- ``'--'`` or ``'dashed'`` dashed line
594- ``'-.'`` or ``'dashdot'`` dash-dotted line
595- ``':'`` or ``'dotted'`` dotted line
596- =========================== =================
582+ Parameters
583+ ----------
584+ ls : str or tuple or list thereof
585+ The line style. Possible values:
597586
598- Alternatively a dash tuple of the following form can be provided: :
587+ - A string :
599588
600- (offset, onoffseq),
589+ ========================================== =================
590+ linestyle description
591+ ========================================== =================
592+ ``'-'`` or ``'solid'`` solid line
593+ ``'--'`` or ``'dashed'`` dashed line
594+ ``'-.'`` or ``'dashdot'`` dash-dotted line
595+ ``':'`` or ``'dotted'`` dotted line
596+ ``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
597+ ========================================== =================
601598
602- where ``onoffseq`` is an even length tuple of on and off ink in points.
599+ - Alternatively a dash tuple of the following form can be
600+ provided::
603601
604- Parameters
605- ----------
606- ls : str or tuple or list thereof
607- Valid values for individual linestyles include {'-', '--', '-.',
608- ':', '', (offset, on-off-seq)}. See `.Line2D.set_linestyle` for a
609- complete description.
602+ (offset, onoffseq)
603+
604+ where ``onoffseq`` is an even length tuple of on and off ink
605+ in points.
606+
607+ If a single value is provided, this applies to all objects in the
608+ collection. A list can be provided to set different line styles to
609+ different objects.
610+
611+ For examples see :doc:`/gallery/lines_bars_and_markers/linestyles`.
612+
613+ The ``'dashed'``, ``'dashdot'``, and ''`dotted'`` line styles are
614+ controlled by :rc:`lines.dashed_pattern`,
615+ :rc:`lines.dashdot_pattern`, and :rc:`lines.dotted_pattern`,
616+ respectively.
610617 """
611- try :
612- if isinstance (ls , str ):
613- ls = cbook .ls_mapper .get (ls , ls )
618+ if isinstance (ls , str ):
619+ dashes = [mlines ._get_dash_pattern (ls )]
620+ else :
621+ try :
614622 dashes = [mlines ._get_dash_pattern (ls )]
615- else :
616- try :
617- dashes = [mlines ._get_dash_pattern (ls )]
618- except ValueError :
619- dashes = [mlines ._get_dash_pattern (x ) for x in ls ]
620-
621- except ValueError as err :
622- raise ValueError ('Do not know how to convert {!r} to '
623- 'dashes' .format (ls )) from err
623+ except ValueError :
624+ dashes = [mlines ._get_dash_pattern (x ) for x in ls ]
624625
625626 # get the list of raw 'unscaled' dash patterns
626627 self ._us_linestyles = dashes
@@ -1522,7 +1523,7 @@ def __init__(self,
15221523 linelength = 1 ,
15231524 linewidth = None ,
15241525 color = None ,
1525- linestyle = 'solid ' ,
1526+ linestyle = '- ' ,
15261527 antialiased = None ,
15271528 ** kwargs
15281529 ):
@@ -1545,14 +1546,8 @@ def __init__(self,
15451546 The line width of the event lines, in points.
15461547 color : color or list of colors, default: :rc:`lines.color`
15471548 The color of the event lines.
1548- linestyle : str or tuple or list thereof, default: 'solid'
1549- Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
1550- '-', '--', '-.', ':']. Dash tuples should be of the form::
1551-
1552- (offset, onoffseq),
1553-
1554- where *onoffseq* is an even length tuple of on and off ink
1555- in points.
1549+ linestyle : str or tuple or list thereof, default: '-'
1550+ Line style or list of line styles. See `set_linestyle` for details.
15561551 antialiased : bool or list thereof, default: :rc:`lines.antialiased`
15571552 Whether to use antialiasing for drawing the lines.
15581553 **kwargs
0 commit comments