'Set the patch linestyle
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):

    if (ls is None):
        ls = u'solid'
    self._linestyle = ls
    (offset, ls) = self._us_dashes = mlines._get_dash_pattern(ls)
    (self._dashoffset, self._dashes) = mlines._scale_dashes(offset, ls, self._linewidth)
    self.stale = True
