'Set the linestyle(s) for the collection.
linestyle                     description
``\'-\'`` or ``\'solid\'``        solid line
``\'--\'`` or  ``\'dashed\'``     dashed line
``\'-.\'`` or  ``\'dashdot\'``    dash-dotted line
``\':\'`` or ``\'dotted\'``       dotted line
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\'`` |
Parameters
ls : { \'-\',  \'--\', \'-.\', \':\'} and more see description
The line style.'

def set_linestyle(self, ls):

    try:
        if isinstance(ls, six.string_types):
            ls = cbook.ls_mapper.get(ls, ls)
            dashes = [mlines._get_dash_pattern(ls)]
        else:
            try:
                dashes = [mlines._get_dash_pattern(ls)]
            except ValueError:
                dashes = [mlines._get_dash_pattern(x) for x in ls]
    except ValueError:
        raise ValueError(u'Do    not    know    how    to    convert    {!r}    to    dashes'.format(ls))
    self._us_linestyles = dashes
    (self._linewidths, self._linestyles) = self._bcast_lwls(self._us_lw, self._us_linestyles)
