'Set the linestyle of the line (also accepts drawstyles,
e.g., ``\'steps--\'``)
linestyle                     description
``\'-\'`` or ``\'solid\'``        solid line
``\'--\'`` or  ``\'dashed\'``     dashed line
``\'-.\'`` or  ``\'dashdot\'``    dash-dotted line
``\':\'`` or ``\'dotted\'``       dotted line
``\'None\'``                    draw nothing
``\' \'``                       draw nothing
``\'\'``                        draw nothing
\'steps\' is equivalent to \'steps-pre\' and is maintained for
backward-compatibility.
Alternatively a dash tuple of the following form can be provided::
(offset, onoffseq),
where ``onoffseq`` is an even length tuple of on and off ink
in points.
ACCEPTS: [\'solid\' | \'dashed\', \'dashdot\', \'dotted\' |
(offset, on-off-dash-seq) |
``\'-\'`` | ``\'--\'`` | ``\'-.\'`` | ``\':\'`` | ``\'None\'`` |
.. seealso::
:meth:`set_drawstyle`
To set the drawing style (stepping) of the plot.
Parameters
ls : { ``\'-\'``,  ``\'--\'``, ``\'-.\'``, ``\':\'``} and more see description
The line style.'

def set_linestyle(self, ls):

    if isinstance(ls, six.string_types):
        (ds, ls) = self._split_drawstyle_linestyle(ls)
        if (ds is not None):
            self.set_drawstyle(ds)
        if (ls in [u'    ', u'', u'none']):
            ls = u'None'
        if (ls not in self._lineStyles):
            try:
                ls = ls_mapper_r[ls]
            except KeyError:
                raise ValueError(u'You    passed    in    an    invalid    linestyle,    `{0}`.        See    docs    of    Line2D.set_linestyle    for    valid    values.'.format(ls))
        self._linestyle = ls
    else:
        self._linestyle = u'--'
    (self._us_dashOffset, self._us_dashSeq) = _get_dash_pattern(ls)
    (self._dashOffset, self._dashSeq) = _scale_dashes(self._us_dashOffset, self._us_dashSeq, self._linewidth)
