def _get_dash_pattern(style):
 if (is_string_like(style) and is_hashable(style)):
  style = ls_mapper.get(style, style)
 if (style in [u'solid', u'None']):
  (offset, dashes) = (None, None)
 elif (style in [u'dashed', u'dashdot', u'dotted']):
  offset = 0
  dashes = tuple(rcParams[u'lines.{}_pattern'.format(style)])
 elif isinstance(style, tuple):
  (offset, dashes) = style
 else:
  raise ValueError((u'Unrecognized linestyle: %s' % str(style)))
 if ((dashes is not None) and (offset is not None)):
  dsum = sum(dashes)
  if dsum:
   offset %= dsum
 return (offset, dashes)

def _get_dash_pattern ( style ) : if ( is_string_like ( style ) and is_hashable ( style ) ) : style = ls_mapper . get ( style , style ) if ( style in [ u'solid' , u'None' ] ) : ( offset , dashes ) = ( None , None ) elif ( style in [ u'dashed' , u'dashdot' , u'dotted' ] ) : offset = 0 dashes = tuple ( rcParams [ u'lines.{}_pattern' . format ( style ) ] ) elif isinstance ( style , tuple ) : ( offset , dashes ) = style else : raise ValueError ( ( u'Unrecognized linestyle: %s' % str ( style ) ) ) if ( ( dashes is not None ) and ( offset is not None ) ) : dsum = sum ( dashes ) if dsum : offset %= dsum return ( offset , dashes )
convert linestyle -> dash pattern .