
 m[c           @` s  d  Z  d d l m Z m Z m Z m Z d d l Z d d l Z d d l Z	 d d l
 m Z m Z m Z m Z m Z d d l m Z m Z d d l m Z m Z m Z m Z m Z m Z d d l m Z d d	 l m Z d d
 l m Z m Z m  Z  d d l
 m! Z! d d l m" Z" m# Z# m$ Z$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ m, Z, m- Z- d   Z. d   Z/ d   Z0 d   Z1 d e f d     YZ2 d e3 f d     YZ4 e2 j5 Z6 e j Z7 e2 j8 Z8 e j9 Z: e j; j< d e j= e2   e j> e2 j?  d S(   un   
This module contains all the 2D line class which can draw with a
variety of line styles, markers and colors.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNi   (   t   artistt   cbookt   colorst	   docstringt   rcParams(   t   Artistt   allow_rasterization(   t   _to_unmasked_float_arrayt   iterablet
   is_numliket	   ls_mappert   ls_mapper_rt   STEP_LOOKUP_MAP(   t   MarkerStyle(   t   Path(   t   Bboxt   TransformedPatht   IdentityTransform(   t   _path(   t	   CARETLEFTt
   CARETRIGHTt   CARETUPt	   CARETDOWNt   CARETLEFTBASEt   CARETRIGHTBASEt   CARETUPBASEt   CARETDOWNBASEt   TICKLEFTt	   TICKRIGHTt   TICKUPt   TICKDOWNc         C` s   t  |  t j  r' t j |  |   }  n  |  d	 k rB d \ } } nb |  d k rp d } t t d j |    } n4 t  |  t  r |  \ } } n t	 d t
 |     | d
 k	 r | d
 k	 r t |  } | r | | ;} q n  | | f S(   u&   Convert linestyle -> dash pattern
    u   solidu   Noneu   dashedu   dashdotu   dottedi    u   lines.{}_patternu   Unrecognized linestyle: %s(   u   solidu   NoneN(   NN(   u   dashedu   dashdotu   dotted(   t
   isinstancet   sixt   string_typesR   t   gett   Nonet   tupleR   t   formatt
   ValueErrort   strt   sum(   t   stylet   offsett   dashest   dsum(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _get_dash_pattern"   s    c         C` s   t  d s |  | f Sd  } } |  d  k	 r7 |  | } n  | d  k	 ru g  | D]" } | d  k	 rf | | n d  ^ qJ } n  | | f S(   Nu   lines.scale_dashes(   R   R'   (   R.   R/   t   lwt   scaled_offsett   scaled_dashest   x(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _scale_dashes>   s    


/c         C` s  t  |  d k  rF t j |  | d | | d | d k  \ } | S| d  | d  } } | d | | d | } }	 | d |	 d }
 |  | | | | |	 |
 } | d k | d k @} |  | d | | d | d k } | | d  | d B@} | | | | | |	 } } |  | d | | d | d k } | | @} | j   j   \ } | j   j   \ } t j | | f  S(   u   
    Determine if any line segments are within radius of a
    point. Returns the list of line segments that are within that
    radius.
    i   ii   i    (   t   lent   npt   nonzerot   ravelt   concatenate(   t   cxt   cyR5   t   yt   radiust   rest   xrt   yrt   dxt   dyt   Lnorm_sqt   ut
   candidatest
   point_hitst   pxt   pyt	   line_hitst   pointst   lines(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   segment_hitsL   s     0$$
c         C` s  | j  | j } } d   } t |  t  r: d |  f }  nE t |  t  rX d |  f }  n' t |  t j  r d |  j   f }  n  t |  t  rCt	 |   d k r t
 d |  f   n  |  \ } } t | t  r(t | t  s t
 d |  f   n  t | t | d	 |  | | t | d	 |    St | t  r-t | t  pRt | t  skt
 d |  f   n  | j | j  }	 t j t	 |	  d f d t }
 d |
 d d	 d	  f <|	 d
 d	  d	 d	  f |	 d	 d  d	 d	  f |
 d
 d	  d	 d	  f <t j |
 d d d
 }
 t j |
  }
 t j |
  }
 | j t j d d g d
 d
 g g   } t j | d d } t j | d  } t j |  } t j | | |
 d | |  } t j |
 t j d	 d	  f | d	 d	  t j f  } | j d d
  } t j |  } t | | | | |   St
 d |  f   n t |  t  rlt | |  | | |    St |   ry t | |  | | |    SWqt
 t f k
 rt
 d |  f   qXn t
 d |  f   d	 S(   u   
    Helper function that sorts out how to deal the input
    `markevery` and returns the points where markers should be drawn.

    Takes in the `markevery` value and the line path and returns the
    sub-sampled path.
    c         S` s   |  d k r d S|  | S(   uY   
        Helper function to cope with `codes` being an
        ndarray or `None`
        N(   R'   (   t   in_vt   slc(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _slice_or_none}   s    g        i    i   u9   `markevery` is a tuple but its len is not 2; markevery=%suq   `markevery` is a tuple with len 2 and second element is an int, but the first element is not an int; markevery=%su}   `markevery` is a tuple with len 2 and second element is a float, but the first element is not a float or an int; markevery=%st   dtypeNi   it   axisu`   `markevery` is a tuple with len 2, but its second element is not an int or a float; markevery=%suR   `markevery` is iterable but not a valid form of numpy fancy indexing; markevery=%su4   Value of `markevery` is not recognized; markevery=%s(   t   codest   verticesR#   t   floatt   intR8   t   integert   itemR(   R7   R*   R   t   sliceR'   t	   transformt   emptyR,   t   sqrtt   cumsumt   arrayt   difft   aranget   abst   newaxist   argmint   uniqueR   t
   IndexError(   t	   markeveryt   tpatht   affinet   ax_transformRT   t   vertsRQ   t   startt   stept   disp_coordst   deltat   scalet   marker_deltat   inds(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _mark_every_pathr   sz    		
	3$


t   Line2Dc           B` s)  e  Z d  Z i d d 6d d 6d d 6d d 6d	 d
 6d	 d 6d	 d 6Z Z i d d 6d d 6d d 6d d 6Z i d d 6Z i  Z e j e  e j e  e	 e  e	 e  Z
 e j Z e j Z e j Z d Z dp Z dq Z d   Z dr dr dr dr dr dr dr dr d dr dr dr dr dr dr d dr dr d  Z d    Z d!   Z d"   Z d#   Z d$   Z d%   Z d&   Z d'   Z d(   Z e j  j! d)    Z  d*   Z" d+   Z# e$ d,  Z% dr d-  Z& d.   Z' d/   Z( d0   Z) e* d1    Z+ d2   Z, d3   Z- d4   Z. d5   Z/ d6   Z0 d7   Z1 d8   Z2 d9   Z3 e$ d:  Z4 d;   Z5 d<   Z6 d=   Z7 e8 d>  Z9 e8 d?  Z: e8 d@  Z; dA   Z< dB   Z= dC   Z> dD   Z? dE   Z@ dF   ZA dG   ZB dH   ZC eD jE dI    ZF dJ   ZG dK   ZH dL   ZI dM   ZJ dN   ZK dO   ZL dP   ZM dQ   ZN dR   ZO e$ dS  ZP e$ dT  ZQ dU   ZR dV   ZS dW   ZT dX   ZU dY   ZV dZ   ZW d[   ZX d\   ZY d]   ZZ d^   Z[ d_   Z\ d`   Z] da   Z^ db   Z_ dc   Z` dd   Za e$ de  Zb df   Zc dg   Zd dh   Ze di   Zf dj   Zg dk   Zh dl   Zi dm   Zj dn   Zk do   Zl RS(s   u  
    A line - the line can have both a solid linestyle connecting all
    the vertices, and a marker at each vertex.  Additionally, the
    drawing of the solid line is influenced by the drawstyle, e.g., one
    can create "stepped" lines in various styles.


    u   _draw_solidu   -u   _draw_dashedu   --u   _draw_dash_dotu   -.u   _draw_dottedu   :u   _draw_nothingu   Noneu    u    u   _draw_linesu   defaultu   _draw_steps_midu	   steps-midu   _draw_steps_preu	   steps-preu   _draw_steps_postu
   steps-postu   stepsi   u   buttu   roundu
   projectingu   miteru   bevelc         C` s   |  j  d k r d |  j  S|  j d  k r- d St |  j  d k r d |  j d |  j d |  j d |  j d |  j d |  j d f Sd d j g  t |  j |  j  D] \ } } d	 | | f ^ q  Sd  S(
   Nu    u
   Line2D(%s)u   Line2D()i   u#   Line2D((%g,%g),(%g,%g),...,(%g,%g))i    iu   ,u   (%g,%g)(   t   _labelt   _xR'   R7   t   _yt   joint   zip(   t   selfR5   R>   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   __str__  s    #	u   nonei   c         K` s%  t  j |   t |  s( t d   n  t |  sC t d   n  | d k r\ t d } n  | d k ru t d } n  | d k r t d } n  | d k r t d } n  | d k r t d } n  | d k r t d } n  | d k r t d	 } n  | d k rt d
 } n  | d k r$t d } n  | d k r=t d } n  t | t j  r|  j	 |  \ } } | d k	 r| d k	 r| | k rt
 d j | |    n  | } | d k	 r| } qn  | d k rd } n  d |  _ d |  _ d |  _ d |  _ |  j |  |  j |  |  j |  |  j |  d |  _ d |  _ | |  _ d |  _ d |  _ d |  _ d |  _ |  j |  |  j |  |  j |  d |  _ |  j |  t  | |  |  _! d |  _" d |  _# d |  _$ |  j% |  |  j& |  |  j' |  d |  _( d |  _) d |  _* d |  _+ |  j, |
  |  j- |  |  j. |	  |  j/ |  d |  _0 |  j1 |  | |  _2 d |  _3 t4 |  j5  r|  j5 |  _2 n  t6 j7 g   |  _8 t6 j7 g   |  _9 t: |  _; t: |  _< d |  _= d |  _> d |  _? d |  _@ d |  _A tB |  _C d |  _D |  jE | |  d S(   u  
        Create a :class:`~matplotlib.lines.Line2D` instance with *x*
        and *y* data in sequences *xdata*, *ydata*.

        The kwargs are :class:`~matplotlib.lines.Line2D` properties:

        %(Line2D)s

        See :meth:`set_linestyle` for a decription of the line styles,
        :meth:`set_marker` for a description of the markers, and
        :meth:`set_drawstyle` for a description of the draw styles.

        u   xdata must be a sequenceu   ydata must be a sequenceu   lines.linewidthu   lines.linestyleu   lines.markeru   lines.coloru   lines.markersizeu   lines.antialiasedu   lines.dash_capstyleu   lines.dash_joinstyleu   lines.solid_capstyleu   lines.solid_joinstyleu4   Inconsistent drawstyle ({0!r}) and linestyle ({1!r})u   defaulti    N(F   R	   t   __init__R   t   RuntimeErrorR'   R   R#   R$   R%   t   _split_drawstyle_linestyleR*   R)   t   _dashcapstylet   _dashjoinstylet   _solidjoinstylet   _solidcapstylet   set_dash_capstylet   set_dash_joinstylet   set_solid_capstylet   set_solid_joinstylet   _linestylest
   _drawstylet
   _linewidtht   _dashSeqt   _dashOffsett   _us_dashSeqt   _us_dashOffsett   set_linestylet   set_drawstylet   set_linewidtht   _colort	   set_colorR   t   _markert
   _markeveryt   _markersizet   _antialiasedt   set_markeveryt   set_antialiasedt   set_markersizet   _markeredgecolort   _markeredgewidtht   _markerfacecolort   _markerfacecoloraltt   set_markerfacecolort   set_markerfacecoloraltt   set_markeredgecolort   set_markeredgewidtht   verticalOffsett   updatet
   pickradiust
   ind_offsetR   t   _pickerR8   t   asarrayt   _xorigt   _yorigt   Truet	   _invalidxt	   _invalidyRv   Rw   t   _xyR   t   _transformed_patht   Falset	   _subslicet	   _x_filledt   set_data(   Rz   t   xdatat   ydatat	   linewidtht	   linestylet   colort   markert
   markersizet   markeredgewidtht   markeredgecolort   markerfacecolort   markerfacecoloraltt	   fillstylet   antialiasedt   dash_capstylet   solid_capstylet   dash_joinstylet   solid_joinstyleR   t	   drawstyleRg   t   kwargst   dst   ls(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR|   "  s    "$																																	c      
   C` s  t  |  j  r |  j |  |  St |  j  s= t d   n  |  j sO |  j r\ |  j   n  t |  j	  d k r{ t
 i  f S|  j   } | j   \ } } | j |  } | j } | d d  d f } | d d  d f } |  j d k rt j d  |  j } n |  j j d |  j } t j d d   |  j d k r| | j d
 | | j d
 }	 t j t j |	 | d
   \ }
 n= t | j | j | | |  }
 |  j j d  r|
 d
 }
 n  Wd QX|
 |  j 7}
 t |
  d k t d |
  f S(   u.  
        Test whether the mouse event occurred on the line.  The pick
        radius determines the precision of the location test (usually
        within five points of the value).  Use
        :meth:`~matplotlib.lines.Line2D.get_pickradius` or
        :meth:`~matplotlib.lines.Line2D.set_pickradius` to view or
        modify it.

        Returns *True* if any values are within the radius along with
        ``{'ind': pointlist}``, where *pointlist* is the set of points
        within the radius.

        TODO: sort returned indices by distance
        u    pick radius should be a distancei    Ni   u,   no figure set when check if mouse is on lineg      R@t   allu   ignoreu   Nonei   u   stepst   ind(   u   NoneN(    t   callablet	   _containsR   R   R*   R   R   t   recacheR7   R   R   t   _get_transformed_patht   get_transformed_path_and_affinet   transform_pathRU   t   figureR'   t   warningst   warnt   dpiR8   t   errstatet
   _linestyleR5   R>   R9   t
   less_equalRN   R   t
   startswithR   t   dict(   Rz   t
   mouseeventt   transformed_patht   pathRi   t   xyt   xtt   ytt   pixelst   dR   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   contains  s6    
	 %c         C` s   |  j  S(   u1   return the pick radius used for containment tests(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_pickradius  s    c         C` s   | |  _  d S(   u   Set the pick radius used for containment tests.

        .. ACCEPTS: float distance in points

        Parameters
        ----------
        d : float
            Pick radius, in points.
        N(   R   (   Rz   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_pickradius  s    
c         C` s   |  j  j   S(   u-   
        return the marker fillstyle
        (   R   t   get_fillstyle(   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   	  s    c         C` s   |  j  j |  t |  _ d S(   u   
        Set the marker fill style; 'full' means fill the whole marker.
        'none' means no filling; other options are for half-filled markers.

        ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top' | 'none']
        N(   R   t   set_fillstyleR   t   stale(   Rz   t   fs(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    c         C` s(   |  j  | k r t |  _ n  | |  _  d S(   u	  Set the markevery property to subsample the plot when using markers.

        e.g., if `every=5`, every 5-th marker will be plotted.

        ACCEPTS: [None | int | length-2 tuple of int | slice |
        list/array of int | float | length-2 tuple of float]

        Parameters
        ----------
        every: None | int | length-2 tuple of int | slice | list/array of int | float | length-2 tuple of float
            Which markers to plot.

            - every=None, every point will be plotted.
            - every=N, every N-th marker will be plotted starting with
              marker 0.
            - every=(start, N), every N-th marker, starting at point
              start, will be plotted.
            - every=slice(start, end, N), every N-th marker, starting at
              point start, upto but not including point end, will be plotted.
            - every=[i, j, m, n], only markers at points i, j, m, and n
              will be plotted.
            - every=0.1, (i.e. a float) then markers will be spaced at
              approximately equal distances along the line; the distance
              along the line between markers is determined by multiplying the
              display-coordinate distance of the axes bounding-box diagonal
              by the value of every.
            - every=(0.5, 0.1) (i.e. a length-2 tuple of float), the
              same functionality as every=0.1 is exhibited but the first
              marker will be 0.5 multiplied by the
              display-cordinate-diagonal-distance along the line.

        Notes
        -----
        Setting the markevery property will only show markers at actual data
        points.  When using float arguments to set the markevery property
        on irregularly spaced data, the markers will likely not appear evenly
        spaced because the actual data points do not coincide with the
        theoretical spacing between markers.

        When using a start offset to specify the first marker, the offset will
        be from the first data point which may be different from the first
        the visible data point if the plot is zoomed in.

        If zooming in on a plot when using float arguments then the actual
        data points that have markers will change because the distance between
        markers is always determined from the display-coordinates
        axes-bounding-box-diagonal regardless of the actual axes data limits.

        N(   R   R   R   (   Rz   t   every(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    3c         C` s   |  j  S(   u   return the markevery setting(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_markeveryP  s    c         C` s.   t  |  r | |  _ n	 | |  _ | |  _ d S(   u   Sets the event picker details for the line.

        ACCEPTS: float distance in points or callable pick function
        ``fn(artist, event)``
        N(   R   R   R   R   (   Rz   t   p(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt
   set_pickerT  s    	c         C` s   t  d d g d d g g  } |  j   j } | j | |  j    d t |  j r |  j d |  j j	 d } | j
 |  } n  | S(   Ni    t   ignoreg      R@g      ?(   R   t   get_transformR[   t   update_from_data_xyt
   get_xydataR   R   R   R   R   t   padded(   Rz   t   renderert   bboxt   trans_data_to_xyt   ms(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_window_extent`  s    	c         C` s   t  j j |  |  | d  k	 r | j d  k	 rO | j j j d |  j  |  _ n  | j	 d  k	 r | j	 j j d |  j  |  _
 q n  d  S(   Nu   units(   R	   t   axest   fsetR'   t   xaxist	   callbackst   connectt   recache_alwayst   _xcidt   yaxist   _ycid(   Rz   t   ax(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   k  s    c         G` sO   t  |  d k r% | d \ } } n | \ } } |  j |  |  j |  d S(   ub   
        Set the x and y data

        ACCEPTS: 2D array (rows are x, y) or two 1D arrays
        i   i    N(   R7   t	   set_xdatat	   set_ydata(   Rz   t   argsR5   R>   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   x  s
    c         C` s   |  j  d t  d  S(   Nt   always(   R   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    c   
      C` s?  | s |  j  r6 |  j |  j  } t |  j   } n	 |  j } | sN |  j ru |  j |  j  } t |  j   } n	 |  j	 } t
 j t
 j | |   j t  |  _ |  j j \ |  _ |  _	 t |  _ |  j rt |  d k r|  j |  r|  j j d k r|  j j   d k r|  j d  k r|  j   t k rt |  _ t
 j |  } | j   r|  j j   |  _ t
 j  t |   } t
 j! | | | | |  j |  |  j | <q|  j |  _ n  |  j" d  k	 r|  j" j# } n d } t$ |  j% |  j j   }	 t& t
 j' |	  j d | |  _" d  |  _( t |  _  t |  _ d  S(   Ni  u   rectilinearu   lineari   t   _interpolation_steps()   R   t   convert_xunitsR   R   R:   Rv   R   t   convert_yunitsR   Rw   R8   t   column_stackt   broadcast_arrayst   astypeRV   R   t   TR   R   R   R7   t
   _is_sortedt   namet
   get_xscaleR   R'   t   get_clip_onR   t   isnant   anyt   copyR   Ra   t   interpR   R  R   R   R   R   R   (
   Rz   R  t   xconvR5   t   yconvR>   t   nanmaskt   indicest   interpolation_stepsR   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     sB    		'	*	#		c         C` s   | d k	 r\ t |  j |  j | d d  f j   } t t j |  j d |  j j	 } n	 |  j } t
 | |  j    |  _ d S(   u   
        Puts a TransformedPath instance at self._transformed_path;
        all invalidation of the transform is then handled by the
        TransformedPath instance.
        NR  (   R'   R   R   R   R
  R   R8   R   R   R  R   R   R   (   Rz   t   subsliceR   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _transform_path  s    )	c         C` s#   |  j  d k r |  j   n  |  j  S(   uk   
        Return the :class:`~matplotlib.transforms.TransformedPath` instance
        of this line.
        N(   R   R'   R  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    c         C` s/   t  j |  |  t |  _ t |  _ t |  _ d S(   u   
        set the Transformation instance used by this artist

        ACCEPTS: a :class:`matplotlib.transforms.Transform` instance
        N(   R	   t   set_transformR   R   R   R   (   Rz   t   t(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR    s    		c         C` s   t  j |  S(   u-   return True if x is sorted in ascending order(   R   t	   is_sorted(   Rz   R5   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR    s    c         C` s  |  j    s d S|  j s" |  j r/ |  j   n  d |  _ |  j r |  j r |  j j   \ } } |  j j	 | g d  \ } |  j j	 | g d  \ } t
 t | d d  | d  } | j |  _ |  j |  n d } |  j   rd d l m } | |  j   |  } n  | j d |  j    |  j |  j d k r|  j   j   \ } }	 t | j  r| j   }
 |  j |
  t j |  j |  j  } |
 j  | d	 t! |
 j" |  j#  |
 j$ |  j%  |  j&   r|  j' } |  j( } n |  j) } |  j* } |
 j+ |  |
 j, |  |
 j- |  j.    |  j/   d k	 rJ|
 j0 |  j/     n  |
 j1 |  j2 |  j3  | j4 |
 | |	 j5    |
 j6   qn  |  j7 r|  j8 d k r| j   }
 |  j |
  |
 j$ |  j9  |
 j" |  j#  t j |  j:   |  j  } t j |  j;   |  j  } t j |  j; d
 t!  |  j  } t< j= |  j> d  rwt< j? |  j@   d  rw| d  | d f } n  |
 j  | d	 t! |  j7 } |  jA   d k rt< jB |  d d d d 4 |  j   |  j |  |  j   j   \ } }	 Wd QXn |  j   j   \ } }	 t | j  r|  jC   } | d k	 rVtD | | |	 |  j jE  } n | } | jF   } tG |  tH k r| jI |  j8  | k } n  |
 j- |  |
 j+ | jJ    |
 j, | jK    | jL   } | jM   } | jI |  j8  } t< j= | jN   d  r|
 j$ d  n | jO |  } | jP |
 | | | |	 j5   |  | jQ   } | r| jR   } | jO |  } | jP |
 | | | |	 j5   |  qn  |
 j6   n  | jS d  tT |  _U d S(   u8   draw the Line with `renderer` unless visibility is FalseNi    u   leftu   righti   (   t   PathEffectRendereru   line2du   _draw_nothingt   isRGBAt   altu   autou   nonei   u   defaultR   R   u   ,(V   t   get_visibleR   R   R   R   R   R   t
   get_xboundR   t   searchsortedRZ   t   maxRl   R  R'   t   get_path_effectst   matplotlib.patheffectsR  t
   open_groupt   get_gidt   _lineStylesR   R   R   R7   RU   t   new_gct   _set_gc_clipt   mcolorst   to_rgbaR   t   _alphat   set_foregroundR   R   R   R   R   t	   is_dashedR   R   R   R   t   set_joinstylet   set_capstylet   set_snapt   get_snapt   get_sketch_paramst   set_sketch_paramst
   set_dashesR   R   t	   draw_patht   frozent   restoreR   R   R   t   get_markeredgecolort   _get_markerfacecolorR   t
   _str_equalR   t   _str_lower_equalt   get_markerfacecolort   get_drawstylet   _setattr_cmR   Rs   t	   transAxest   get_snap_thresholdt   typeRV   t   points_to_pixelst   get_joinstylet   get_capstylet   get_pathR   t
   get_markerRp   t   draw_markerst   get_alt_patht   get_alt_transformt   close_groupR   R   (   Rz   R   t   x0t   x1t   i0t   i1R  R  Rh   Ri   t   gct   lc_rgbat   capRx   t   ec_rgbat   fc_rgbat
   fcalt_rgbaR   Rg   t
   subsampledt   snapt   marker_patht   marker_transt   wt   alt_marker_patht   alt_marker_trans(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   draw  s    	 				
!	c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_antialiased]  s    c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt	   get_color`  s    c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR?  c  s    c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_linestylef  s    c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_linewidthi  s    c         C` s   |  j  j   S(   N(   R   RH  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRH  l  s    c         C` s   |  j  } t | t j  r| | d k r| t d ru |  j j   d k rM |  j S|  j j   ru |  j	   d k ru d Sn  |  j S| Sd  S(   Nu   autou   _internal.classic_modeu   .u   ,u   noneu   k(   u   .u   ,(
   R   R#   R$   R%   R   R   RH  R   t	   is_filledR   (   Rz   t   mec(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR:  o  s    	
!c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_markeredgewidth{  s    c         C` sU   | r |  j  } n	 |  j } t j | d  rM |  j   d k rC d S|  j Sn | Sd  S(   Nu   autou   none(   R   R   R   R=  R   R   (   Rz   R  t   fc(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR;  ~  s    	
c         C` s   |  j  d t  S(   NR  (   R;  R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR>    s    c         C` s   |  j  d t  S(   NR  (   R;  R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_markerfacecoloralt  s    c         C` s   |  j  S(   N(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_markersize  s    c         C` s"   |  j  d |  |  j d |  f S(   ub   
        Return the xdata, ydata.

        If *orig* is *True*, return the original data.
        t   orig(   t	   get_xdatat	   get_ydata(   Rz   Ri  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_data  s    c         C` s*   | r |  j  S|  j r# |  j   n  |  j S(   u|   
        Return the xdata.

        If *orig* is *True*, return the original data, else the
        processed data.
        (   R   R   R   Rv   (   Rz   Ri  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRj    s
    	c         C` s*   | r |  j  S|  j r# |  j   n  |  j S(   u|   
        Return the ydata.

        If *orig* is *True*, return the original data, else the
        processed data.
        (   R   R   R   Rw   (   Rz   Ri  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRk    s
    	c         C` s&   |  j  s |  j r |  j   n  |  j S(   ue   
        Return the :class:`~matplotlib.path.Path` object associated
        with this line.
        (   R   R   R   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRG    s    c         C` s&   |  j  s |  j r |  j   n  |  j S(   u<   
        Return the *xy* data as a Nx2 numpy array.
        (   R   R   R   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    c         C` s(   |  j  | k r t |  _ n  | |  _  d S(   u   
        Set whether to use antialiased rendering.

        Parameters
        ----------
        b : bool
            .. ACCEPTS: bool
        N(   R   R   R   (   Rz   t   b(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    	c         C` s   | |  _  t |  _ d S(   uR   
        Set the color of the line

        ACCEPTS: any matplotlib color
        N(   R   R   R   (   Rz   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    	c         C` sm   | d k r d } n  | |  j k r< t d j |    n  |  j | k r` t |  _ t |  _ n  | |  _ d S(   uQ  
        Set the drawstyle of the plot

        'default' connects the points with lines. The steps variants
        produce step-plots. 'steps' is equivalent to 'steps-pre' and
        is maintained for backward-compatibility.

        ACCEPTS: ['default' | 'steps' | 'steps-pre' | 'steps-mid' |
                  'steps-post']
        u   defaultu   Unrecognized drawstyle {!r}N(   R'   t
   drawStylesR*   R)   R   R   R   R   (   Rz   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    		c         C` s[   t  |  } |  j | k r' t |  _ n  | |  _ t |  j |  j |  j  \ |  _ |  _ d S(   uV   
        Set the line width in points

        ACCEPTS: float value in points
        N(	   RV   R   R   R   R6   R   R   R   R   (   Rz   R[  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    	c         C` sn   d } x[ |  j D]P } | j |  r | } t |  t |  k rV | t |  } n d } Pq q W| | f S(   u  Split drawstyle from linestyle string

        If `ls` is only a drawstyle default to returning a linestyle
        of '-'.

        Parameters
        ----------
        ls : str
            The linestyle to be processed

        Returns
        -------
        ret_ds : str or None
            If the linestyle string does not contain a drawstyle prefix
            return None, otherwise return it.

        ls : str
            The linestyle with the drawstyle (if any) stripped.
        u   -N(   R'   t   drawStyleKeysR   R7   (   Rz   R   t   ret_dsR   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR~     s    c         C` s   t  | t j  r |  j |  \ } } | d k	 rC |  j |  n  | d k rX d } n  | |  j k r y t | } Wq t k
 r t	 d j
 |    q Xn  | |  _ n	 d |  _ t |  \ |  _ |  _ t |  j |  j |  j  \ |  _ |  _ d S(	   u  
        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.
        u    u    u   noneu   Noneu^   You passed in an invalid linestyle, `{0}`.  See docs of Line2D.set_linestyle for valid values.u   --N(   u    u    u   none(   R#   R$   R%   R~   R'   R   R(  R   t   KeyErrorR*   R)   R   R1   R   R   R6   R   R   R   (   Rz   R   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   !  s"    ,			c         C` s   |  j  j |  t |  _ d S(   u
  
        Set the line marker

        ACCEPTS: :mod:`A valid marker style <matplotlib.markers>`

        Parameters
        ----------

        marker: marker style
            See `~matplotlib.markers` for full description of possible
            argument

        N(   R   t
   set_markerR   R   (   Rz   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRr  g  s    c         C` sU   | d k r d } n  |  j d k s< t j |  j | k  rH t |  _ n  | |  _ d S(   uR   
        Set the marker edge color

        ACCEPTS: any matplotlib color
        u   autoN(   R'   R   R8   R  R   R   (   Rz   t   ec(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   y  s    	c         C` sA   | d k r t d } n  |  j | k r4 t |  _ n  | |  _ d S(   u]   
        Set the marker edge width in points

        ACCEPTS: float value in points
        u   lines.markeredgewidthN(   R'   R   R   R   R   (   Rz   t   ew(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s
    c         C` sF   | d k r d } n  t j |  j | k  r9 t |  _ n  | |  _ d S(   uS   
        Set the marker face color.

        ACCEPTS: any matplotlib color
        u   autoN(   R'   R8   R  R   R   R   (   Rz   Rf  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s
    	c         C` sF   | d k r d } n  t j |  j | k  r9 t |  _ n  | |  _ d S(   u]   
        Set the alternate marker face color.

        ACCEPTS: any matplotlib color
        u   autoN(   R'   R8   R  R   R   R   (   Rz   Rf  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s
    	c         C` s4   t  |  } |  j | k r' t |  _ n  | |  _ d S(   uG   
        Set the marker size in points

        ACCEPTS: float
        N(   RV   R   R   R   (   Rz   t   sz(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    c         C` s   | |  _  t |  _ t |  _ d S(   uH   
        Set the data np.array for x

        ACCEPTS: 1D array
        N(   R   R   R   R   (   Rz   R5   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR     s    		c         C` s   | |  _  t |  _ t |  _ d S(   uH   
        Set the data np.array for y

        ACCEPTS: 1D array
        N(   R   R   R   R   (   Rz   R>   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR    s    		c         C` sE   | d k s t |  d k r. |  j d  n |  j d | f  d S(   u   
        Set the dash sequence, sequence of dashes with on off ink in
        points.  If seq is empty or if seq = (None, None), the
        linestyle will be set to solid.

        ACCEPTS: sequence of on/off ink in points
        i    u   -N(   NN(   R'   R7   R   (   Rz   t   seq(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR6    s    c         C` s  t  j |  |  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j	 |  _	 | j
 |  _
 | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ t | j j   | j j    |  _ | j |  _ d S(   u"   copy properties from other to selfN(   R	   t   update_fromR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   RH  R   R   (   Rz   t   other(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRw    s*    c         C` s   t  j |  j d |  |  j  S(   NR  (   R+  R,  R;  R-  (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _get_rgba_face  s    c         C` s   t  j |  j |  j  S(   N(   R+  R,  R   R-  (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   _get_rgba_ln_color  s    c         C` s   |  j  |  d S(   u   alias for set_antialiasedN(   R   (   Rz   t   val(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_aa  s    c         C` s   |  j  |  d S(   u   alias for set_colorN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_c  s    c         C` s   |  j  |  d S(   u   alias for set_linestyleN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_ls  s    c         C` s   |  j  |  d S(   u   alias for set_linewidthN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_lw  s    c         C` s   |  j  |  d S(   u   alias for set_markeredgecolorN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_mec  s    c         C` s   |  j  |  d S(   u   alias for set_markeredgewidthN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_mew
  s    c         C` s   |  j  |  d S(   u   alias for set_markerfacecolorN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_mfc  s    c         C` s   |  j  |  d S(   u    alias for set_markerfacecoloraltN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt
   set_mfcalt  s    c         C` s   |  j  |  d S(   u   alias for set_markersizeN(   R   (   Rz   R{  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   set_ms  s    c         C` s
   |  j    S(   u   alias for get_antialiased(   R_  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_aa  s    c         C` s
   |  j    S(   u   alias for get_color(   R`  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_c  s    c         C` s
   |  j    S(   u   alias for get_linestyle(   Ra  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_ls"  s    c         C` s
   |  j    S(   u   alias for get_linewidth(   Rb  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_lw&  s    c         C` s
   |  j    S(   u   alias for get_markeredgecolor(   R:  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_mec*  s    c         C` s
   |  j    S(   u   alias for get_markeredgewidth(   Re  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_mew.  s    c         C` s
   |  j    S(   u   alias for get_markerfacecolor(   R>  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_mfc2  s    c         C` s
   |  j    S(   u    alias for get_markerfacecoloralt(   Rg  (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt
   get_mfcalt6  s    c         C` s
   |  j    S(   u   alias for get_markersize(   Rh  (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_ms:  s    c         C` sg   | j    } | |  j k r? t d | f d |  j f   n  |  j | k rZ t |  _ n  | |  _ d S(   ui   
        Set the join style for dashed linestyles
        ACCEPTS: ['miter' | 'round' | 'bevel']
        u    set_dash_joinstyle passed "%s";
u   valid joinstyles are %sN(   t   lowert	   validJoinR*   R   R   R   (   Rz   t   s(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   >  s    c         C` sg   | j    } | |  j k r? t d | f d |  j f   n  |  j | k rZ t |  _ n  | |  _ d S(   uh   
        Set the join style for solid linestyles
        ACCEPTS: ['miter' | 'round' | 'bevel']
        u!   set_solid_joinstyle passed "%s";
u   valid joinstyles are %sN(   R  R  R*   R   R   R   (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   K  s    c         C` s   |  j  S(   u:   
        Get the join style for dashed linestyles
        (   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_dash_joinstyleY  s    c         C` s   |  j  S(   u9   
        Get the join style for solid linestyles
        (   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_solid_joinstyle_  s    c         C` sg   | j    } | |  j k r? t d | f d |  j f   n  |  j | k rZ t |  _ n  | |  _ d S(   um   
        Set the cap style for dashed linestyles

        ACCEPTS: ['butt' | 'round' | 'projecting']
        u   set_dash_capstyle passed "%s";
u   valid capstyles are %sN(   R  t   validCapR*   R   R   R   (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   e  s    c         C` sg   | j    } | |  j k r? t d | f d |  j f   n  |  j | k rZ t |  _ n  | |  _ d S(   um   
        Set the cap style for solid linestyles

        ACCEPTS: ['butt' | 'round' |  'projecting']
        u    set_solid_capstyle passed "%s";
u   valid capstyles are %sN(   R  R  R*   R   R   R   (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR   s  s    c         C` s   |  j  S(   u9   
        Get the cap style for dashed linestyles
        (   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_dash_capstyle  s    c         C` s   |  j  S(   u8   
        Get the cap style for solid linestyles
        (   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   get_solid_capstyle  s    c         C` s   |  j  d k S(   u    return True if line is dashstyleu   --u   -.u   :(   u   --u   -.u   :(   R   (   Rz   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR/    s    (   u   buttu   roundu
   projecting(   u   miteru   roundu   bevelN(m   t   __name__t
   __module__t   __doc__t
   lineStylesR(  t   _drawStyles_lt   _drawStyles_sRn  R   t   listRo  R   t   markerst   filled_markerst
   fillstylest
   fillStylest   zorderR  R  R{   R'   R|   R   R   R   R   R   R   R   R   R   R	   R   t   setterR   R   R   R   R  R   R  R  R
   R^  R_  R`  R?  Ra  Rb  RH  R:  Re  R;  R>  Rg  Rh  R   Rl  Rj  Rk  RG  R   R   R   R   R   R~   R   R   t   dedent_interpdRr  R   R   R   R   R   R   R  R6  Rw  Ry  Rz  R|  R}  R~  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R   R  R  R   R   R  R  R/  (    (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyRt      s   

					@				
	7					*																								 	F						
	
																											t   VertexSelectorc           B` s)   e  Z d  Z d   Z d   Z d   Z RS(   u  
    Manage the callbacks to maintain a list of selected vertices for
    :class:`matplotlib.lines.Line2D`. Derived classes should override
    :meth:`~matplotlib.lines.VertexSelector.process_selected` to do
    something with the picks.

    Here is an example which highlights the selected verts with red
    circles::

        import numpy as np
        import matplotlib.pyplot as plt
        import matplotlib.lines as lines

        class HighlightSelected(lines.VertexSelector):
            def __init__(self, line, fmt='ro', **kwargs):
                lines.VertexSelector.__init__(self, line)
                self.markers, = self.axes.plot([], [], fmt, **kwargs)

            def process_selected(self, ind, xs, ys):
                self.markers.set_data(xs, ys)
                self.canvas.draw()

        fig, ax = plt.subplots()
        x, y = np.random.rand(2, 30)
        line, = ax.plot(x, y, 'bs-', picker=5)

        selector = HighlightSelected(line)
        plt.show()

    c         C` s   | j  d k r t d   n  | j   d k r? t d   n  | j  |  _  | |  _ |  j  j j |  _ |  j j d |  j  |  _	 t
   |  _ d S(   u   
        Initialize the class with a :class:`matplotlib.lines.Line2D`
        instance.  The line should already be added to some
        :class:`matplotlib.axes.Axes` instance and should have the
        picker property set.
        u'   You must first add the line to the Axesu2   You must first set the picker property of the lineu
   pick_eventN(   R   R'   R}   t
   get_pickert   lineR   t   canvast   mpl_connectt   onpickt   cidt   setR   (   Rz   R  (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR|     s    	c         C` s   d S(   u   
        Default "do nothing" implementation of the
        :meth:`process_selected` method.

        *ind* are the indices of the selected vertices.  *xs* and *ys*
        are the coordinates of the selected vertices.
        N(    (   Rz   R   t   xst   ys(    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   process_selected  s    c         C` sq   | j  |  j k	 r d S|  j t | j  N_ t |  j  } |  j j   \ } } |  j | | | | |  d S(   u<   When the line is picked, update the set of selected indices.N(   R   R  R   R  t   sortedRl  R  (   Rz   t   eventR   R   R   (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR    s    (   R  R  R  R|   R  R  (    (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyR    s   		
(@   R  t
   __future__R    R   R   R   R$   R   t   numpyR8   t    R   R   R   R+  R   R   R	   R
   R   R   R   R   R   R   R  R   R   R   t
   transformsR   R   R   R   R   R   R   R   R   R   R   R   R   R    R!   R"   R1   R6   RN   Rs   Rt   t   objectR  R(  R  t   lineMarkersRn  R  R  t   interpdR   t   kwdocR  R|   (    (    (    s/   lib/python2.7/site-packages/matplotlib/lines.pyt   <module>   s8   "(.R			&	s    H				