def set_linestyle(self, linestyle):
<EOL>for ds in flatten([list(k.keys()) for k in (self._drawStyles_l,<EOL>self._drawStyles_s)], is_string_like):<EOL><INDENT>if linestyle.startswith(ds):<EOL><INDENT>self.set_drawstyle(ds)<EOL>if len(linestyle) > len(ds):<EOL><INDENT>linestyle = linestyle[len(ds):]<EOL><DEDENT>else:<EOL><INDENT>linestyle = '<STR_LIT:->'<EOL><DEDENT><DEDENT><DEDENT>if linestyle not in self._lineStyles:<EOL><INDENT>if linestyle in ls_mapper:<EOL><INDENT>linestyle = ls_mapper[linestyle]<EOL><DEDENT>else:<EOL><INDENT>verbose.report('<STR_LIT>' %<EOL>(linestyle, type(linestyle)))<EOL><DEDENT><DEDENT>if linestyle in ['<STR_LIT:U+0020>','<STR_LIT>']:<EOL><INDENT>linestyle = '<STR_LIT:None>'<EOL><DEDENT>self._linestyle = linestyle<EOL>
Set the linestyle of the line (also accepts drawstyles)


================    =================
linestyle           description
================    =================
'-'                 solid
'--'                dashed
'-.'                dash_dot
':'                 dotted
'None'              draw nothing
' '                 draw nothing
''                  draw nothing
================    =================

'steps' is equivalent to 'steps-pre' and is maintained for
backward-compatibility.

.. seealso::
    :meth:`set_drawstyle`

ACCEPTS: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and
any drawstyle in combination with a linestyle, e.g. 'steps--'.