
 m[c           @` s%  d  d l  m Z m Z m Z m Z d  d l Z d  d l m Z m Z d  d l	 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 m Z d d l m Z m Z m Z m Z m Z m Z m Z m Z m  Z  d d l! m" Z" i d g d	 6d
 g d 6d g d 6d g d 6d g d 6Z# d e j$ f d     YZ% e j& e%  Z' xL d d d d d d d d d d d d d  f D] Z( e j) j* i e' e( 6 qWe j+ e% j,  d! e% f d"     YZ- d# e% f d$     YZ. d% e% f d&     YZ/ d' e% f d(     YZ0 d) e% f d*     YZ1 d+ e% f d,     YZ2 d- e% f d.     YZ3 d/ e1 f d0     YZ4 e j) j* i e4 j, j5 d 6 d1 e% f d2     YZ6 d3 e/ f d4     YZ7 d5 e% f d6     YZ8 d7 e8 f d8     YZ9 d9 e8 f d:     YZ: e; e< d;  Z= d< e; d=  Z> d> d?  Z? d@   Z@ dA   ZA dB eB f dC     YZC dD eC f dE     YZD e j) j* dF e@ eD jE  dG eA eD jE   dH e% f dI     YZF dJ eC f dK     YZG dL   ZH dM eC f dN     YZI e j) j* dO e@ eI jE  dP e@ eG jE   dQ e% f dR     YZJ dS eJ f dT     YZK d S(U   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   mapt   zipi   (   t   artistt   cbookt   colorst	   docstringt   linest
   transforms(	   t   concatenate_pathst   get_cos_sint   get_intersectiont   get_parallelst   inside_circlet   make_path_regulart   make_wedged_bezier2t)   split_bezier_intersecting_with_closedpatht   split_path_inout(   t   Pathu   aau   antialiasedu   ecu	   edgecoloru   fcu	   facecoloru   lwu	   linewidthu   lsu	   linestylet   Patchc           B` s   e  Z d  Z d Z d1 Z d2 Z e Z d   Z d3 d3 d3 d3 d3 d3 d3 e
 d3 d3 d 
 Z d	   Z d
   Z d3 d  Z d3 d  Z d3 d  Z d   Z d   Z d   Z d   Z d   Z d   Z e Z d   Z e Z d   Z e Z d   Z e Z d   Z e Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' d    Z( d!   Z) d"   Z* d#   Z+ d$   Z, d%   Z- d&   Z. d'   Z/ e0 e/ e.  Z1 d(   Z2 d)   Z3 d*   Z4 d+   Z5 d,   Z6 d-   Z7 e8 j9 d.    Z: d/   Z; d3 d0  Z< RS(4   u   
    A patch is a 2D artist with a face color and an edge color.

    If any of *edgecolor*, *facecolor*, *linewidth*, or *antialiased*
    are *None*, they default to their rc params setting.
    i   u   buttu   roundu
   projectingu   miteru   bevelc         C` s   t  |  j  j d  d S(   Nu   .i(   t   strt	   __class__t   split(   t   self(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   __str__.   s    c         K` s  t  j j |   | d	 k r, t j d } n  | d	 k rA d } n  |	 d	 k rV d }	 n  |
 d	 k rk d }
 n  | d	 k r t j d } n  t j t j d  |  _ t	 |  _
 | d	 k	 r | d	 k	 s | d	 k	 r t j d  n  |  j |  n |  j |  |  j |  d	 |  _ d |  _ |  j |  |  j |  |  j |  |  j |  |  j |  |  j |	  |  j |
  t j   |  _ t |  r|  j |  n  d	 S(
   uQ   
        The following kwarg properties are supported

        %(Patch)s
        u   patch.linewidthu   solidu   buttu   miteru   patch.antialiasedu   hatch.coloruQ   Setting the 'color' property will overridethe edgecolor or facecolor properties. i    N(   R   t   Artistt   __init__t   Nonet   mplt   rcParamsR   t   to_rgbat   _hatch_colort   Truet   _fillt   warningst   warnt	   set_colort   set_edgecolort   set_facecolort
   _us_dashest
   _linewidtht   set_fillt   set_linestylet   set_linewidtht   set_antialiasedt	   set_hatcht   set_capstylet   set_joinstyleR   t   IdentityTransformt   _combined_transformt   lent   update(   R   t	   edgecolort	   facecolort   colort	   linewidtht	   linestylet   antialiasedt   hatcht   fillt   capstylet	   joinstylet   kwargs(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   1   s>    						c         C` s?   |  j    } |  j   } | j |  } t |  r; | d Sg  S(   u   
        Return a copy of the vertices used in this patch

        If the patch contains Bezier curves, the curves will be
        interpolated by line segments.  To access the curves as
        curves, use :meth:`get_path`.
        i    (   t   get_transformt   get_patht   to_polygonsR5   (   R   t   transt   patht   polygons(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   get_vertsi   s    c         C` s]   | d  k	 r | St j |  j  r. |  j } n+ |  j   d d k rM d } n |  j   } | S(   Ni   i    (   R   R   t
   is_numliket   _pickert   get_edgecolort   get_linewidth(   R   t   radiust   _radius(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _process_radiusx   s    	c         C` se   t  |  j  r |  j |  |  S|  j |  } |  j   j | j | j f |  j   |  } | i  f S(   uU   Test whether the mouse event occurred in the patch.

        Returns T/F, {}
        (   t   callablet	   _containsRO   RC   t   contains_pointt   xt   yRB   (   R   t
   mouseeventRM   t   inside(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   contains   s    !c         C` s.   |  j  |  } |  j   j | |  j   |  S(   u   
        Returns ``True`` if the given *point* is inside the path
        (transformed with its transform attribute).

        *radius* allows the path to be made slightly larger or smaller.
        (   RO   RC   RR   RB   (   R   t   pointRM   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRR      s    	c         C` s.   |  j  |  } |  j   j | |  j   |  S(   u  
        Returns a bool array which is ``True`` if the (closed) path
        contains the corresponding point.
        (transformed with its transform attribute).

        *points* must be Nx2 array.
        *radius* allows the path to be made slightly larger or smaller.
        (   RO   RC   t   contains_pointsRB   (   R   t   pointsRM   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRY      s    		c         C` s   t  j j |  |  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ |  j	 | j
  |  j | j    d S(   uM   
        Updates this :class:`Patch` from the properties of *other*.
        N(   R   R   t   update_fromt
   _edgecolort
   _facecolorR$   t   _hatchR"   R*   R.   R+   t   set_transformt   get_data_transform(   R   t   other(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR[      s    c         C` s   |  j    j |  j    S(   u   
        Return a :class:`~matplotlib.transforms.Bbox` object defining
        the axis-aligned extents of the :class:`Patch`.
        (   RC   t   get_extentsRB   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRb      s    c         C` s   |  j    t j j |   S(   um   
        Return the :class:`~matplotlib.transforms.Transform` applied
        to the :class:`Patch`.
        (   t   get_patch_transformR   R   RB   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRB      s    c         C` s   t  j j |   S(   u   
        Return the :class:`~matplotlib.transforms.Transform` instance which
        maps data coordinates to physical coordinates.
        (   R   R   RB   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR`      s    c         C` s
   t  j   S(   uh  
        Return the :class:`~matplotlib.transforms.Transform` instance which
        takes patch coordinates to data coordinates.

        For example, one may define a patch of a circle which represents a
        radius of 5 by providing coordinates for a unit circle, and a
        transform which scales the coordinates (the patch coordinate) by 5.
        (   R   R3   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc      s    	c         C` s   |  j  S(   uV   
        Returns True if the :class:`Patch` is to be drawn with antialiasing.
        (   t   _antialiased(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_antialiased   s    c         C` s   |  j  S(   u>   
        Return the edge color of the :class:`Patch`.
        (   R\   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRK      s    c         C` s   |  j  S(   u>   
        Return the face color of the :class:`Patch`.
        (   R]   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_facecolor   s    c         C` s   |  j  S(   u2   
        Return the line width in points.
        (   R+   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRL      s    c         C` s   |  j  S(   uk   
        Return the linestyle.  Will be one of ['solid' | 'dashed' |
        'dashdot' | 'dotted']
        (   t
   _linestyle(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_linestyle   s    c         C` s2   | d k r t j d } n  | |  _ t |  _ d S(   u   
        Set whether to use antialiased rendering.

        Parameters
        ----------
        b : bool or None
            .. ACCEPTS: bool or None
        u   patch.antialiasedN(   R   R   R    Rd   R#   t   stale(   R   t   aa(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR/      s    		c         C` s   |  j  |  S(   u   alias for set_antialiased(   R/   (   R   Rj   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_aa  s    c         C` s   t  } | d  k rQ t j d s2 |  j s2 |  j rB t j d } qQ d } t } n  t j | |  j	  |  _
 | r~ |  j
 |  _ n  t  |  _ d  S(   Nu   patch.force_edgecoloru   patch.edgecoloru   none(   R#   R   R   R    R$   t   _edge_defaultt   FalseR   R!   t   _alphaR\   R"   Ri   (   R   R9   t   set_hatch_color(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_edgecolor  s    	c         C` s   | |  _  |  j |  d S(   ud   
        Set the patch edge color

        ACCEPTS: mpl color spec, None, 'none', or 'auto'
        N(   t   _original_edgecolorRp   (   R   R9   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR(      s    	c         C` s   |  j  |  S(   u   alias for set_edgecolor(   R(   (   R   R9   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_ec)  s    c         C` sV   | d  k r t j d } n  |  j r. |  j n d } t j | |  |  _ t |  _	 d  S(   Nu   patch.facecolori    (
   R   R   R    R$   Rn   R   R!   R]   R#   Ri   (   R   R9   t   alpha(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_facecolor-  s
    c         C` s   | |  _  |  j |  d S(   ux   
        Set the patch face color

        ACCEPTS: mpl color spec, or None for default, or 'none' for no color
        N(   t   _original_facecolorRt   (   R   R9   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR)   4  s    	c         C` s   |  j  |  S(   u   alias for set_facecolor(   R)   (   R   R9   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_fc=  s    c         C` s   |  j  |  |  j |  d S(   u   
        Set both the edgecolor and the facecolor.

        ACCEPTS: matplotlib color spec

        .. seealso::

            :meth:`set_facecolor`, :meth:`set_edgecolor`
               For setting the edge or face color individually.
        N(   R)   R(   (   R   t   c(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR'   A  s    c         C` st   | d k	 r= y t |  Wq= t k
 r9 t d   q= Xn  t j j |  |  |  j |  j  |  j |  j	  d S(   uY   
        Set the alpha tranparency of the patch.

        ACCEPTS: float or None
        u   alpha must be a float or NoneN(
   R   t   floatt	   TypeErrorR   R   t	   set_alphaRt   Ru   Rp   Rq   (   R   Rs   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRz   O  s    c         C` s   | d k r8 t j d } | d k r8 t j d } q8 n  t |  |  _ |  j \ } } t j | | |  j  \ |  _ |  _	 t
 |  _ d S(   u_   
        Set the patch linewidth in points

        ACCEPTS: float or None for default
        u   patch.linewidthu   axes.linewidthN(   R   R   R    Rx   R+   R*   t   mlinest   _scale_dashest   _dashoffsett   _dashesR#   Ri   (   R   t   wt   offsett   ls(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR.   _  s    c         C` s   |  j  |  S(   u   alias for set_linewidth(   R.   (   R   t   lw(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_lwq  s    c         C` sk   | d k r d } n  | |  _ t j |  \ } } |  _ t j | | |  j  \ |  _ |  _ t	 |  _
 d S(   u  
        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.
        u   solidN(   R   Rg   R{   t   _get_dash_patternR*   R|   R+   R}   R~   R#   Ri   (   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR-   u  s    		c         C` s   |  j  |  S(   u   alias for set_linestyle(   R-   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_ls  s    c         C` s<   t  |  |  _ |  j |  j  |  j |  j  t |  _ d S(   u   
        Set whether to fill the patch.

        Parameters
        ----------
        b : bool
            .. ACCEPTS: bool
        N(   t   boolR$   Rt   Ru   Rp   Rq   R#   Ri   (   R   t   b(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR,     s    	c         C` s   |  j  S(   u   return whether fill is set(   R$   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_fill  s    c         C` sU   | j    } | |  j k r? t d | f d |  j f   n  | |  _ t |  _ d S(   u\   
        Set the patch capstyle

        ACCEPTS: ['butt' | 'round' | 'projecting']
        u   set_capstyle passed "%s";
u   valid capstyles are %sN(   t   lowert   validCapt
   ValueErrort	   _capstyleR#   Ri   (   R   t   s(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR1     s    	c         C` s   |  j  S(   u   Return the current capstyle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_capstyle  s    c         C` sU   | j    } | |  j k r? t d | f d |  j f   n  | |  _ t |  _ d S(   uY   
        Set the patch joinstyle

        ACCEPTS: ['miter' | 'round' | 'bevel']
        u   set_joinstyle passed "%s";
u   valid joinstyles are %sN(   R   t	   validJoinR   t
   _joinstyleR#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR2     s    	c         C` s   |  j  S(   u   Return the current joinstyle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_joinstyle  s    c         C` s   | |  _  t |  _ d S(   u  
        Set the hatching pattern

        *hatch* can be one of::

          /   - diagonal hatching
          \   - back diagonal
          |   - vertical
          -   - horizontal
          +   - crossed
          x   - crossed diagonal
          o   - small circle
          O   - large circle
          .   - dots
          *   - stars

        Letters can be combined, in which case all the specified
        hatchings are done.  If same letter repeats, it increases the
        density of hatching of that pattern.

        Hatching is supported in the PostScript, PDF, SVG and Agg
        backends only.

        ACCEPTS: ['/' | '\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*']
        N(   R^   R#   Ri   (   R   R=   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR0     s    	c         C` s   |  j  S(   u#   Return the current hatching pattern(   R^   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   get_hatch  s    c   
      C` s9  |  j    s d S| j d |  j    | j   } | j |  j d t |  j } |  j d d k rm d } n  | j |  | j	 d |  j
  | j |  j  | j |  j  | j |  j  |  j |  | j |  j  | j |  j    |  j } | d d k rd } n  | j |  j  |  j rp| j |  j  y | j |  j  Wqpt k
 rlt j  d  qpXn  |  j!   d k	 r| j" |  j!     n  |  j#   } |  j$   } | j% |  } | j&   } |  j'   rd d l( m) }	 |	 |  j'   |  } n  | j* | | | |  | j+   | j, d  t- |  _. d S(   u0   Draw the :class:`Patch` to the given *renderer*.Nu   patcht   isRGBAi   i    u?   Your backend does not have support for setting the hatch color.(   t   PathEffectRenderer(/   t   get_visiblet
   open_groupt   get_gidt   new_gct   set_foregroundR\   R#   R+   R.   t
   set_dashesR~   R1   R   R2   R   R/   Rd   t   _set_gc_clipt   set_urlt   _urlt   set_snapt   get_snapR]   R   Rz   Rn   R^   R0   Ro   R"   t   AttributeErrorR%   R&   t   get_sketch_paramst   set_sketch_paramsRC   RB   t   transform_path_non_affinet
   get_affinet   get_path_effectst   matplotlib.patheffectsR   t	   draw_patht   restoret   close_groupRm   Ri   (
   R   t   renderert   gcR   t   rgbFaceRF   t	   transformt   tpatht   affineR   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   draw  sN    					
c         C` s   t  d   d S(   u/   
        Return the path of this patch
        u   Derived must overrideN(   t   NotImplementedError(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC   4  s    c         C` s   |  j    j |  j    S(   N(   RC   Rb   RB   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_window_extent:  s    (   u   buttu   roundu
   projecting(   u   miteru   roundu   bevelN(=   t   __name__t
   __module__t   __doc__t   zorderR   R   Rm   Rl   R   R   R#   R   RH   RO   RW   RR   RY   R[   Rb   RB   R`   Rc   Re   t   get_aaRK   t   get_ecRf   t   get_fcRL   t   get_lwRh   t   get_lsR/   Rk   Rp   R(   Rr   Rt   R)   Rv   R'   Rz   R.   R   R-   R   R,   R   t   propertyR>   R1   R   R2   R   R0   R   R   t   allow_rasterizationR   RC   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR      s|   	.																											(									9	u	   Rectangleu   Circleu   RegularPolygonu   Polygonu   Wedgeu   Arrowu
   FancyArrowu   YAArrowu   CirclePolygonu   Ellipseu   Arcu   FancyBboxPatchu   Patcht   Shadowc           B` sw   e  Z d    Z e j d d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z d
   Z RS(   c         C` s   d t  |  j  S(   Nu
   Shadow(%s)(   R   t   patch(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   I  s    c         K` sO   t  j |   | |  _ | |  _ | | |  _ |  _ t j   |  _ |  j	   d S(   u  
        Create a shadow of the given *patch* offset by *ox*, *oy*.
        *props*, if not *None*, is a patch property update dictionary.
        If *None*, the shadow will have have the same color as the face,
        but darkened.

        kwargs are
        %(Patch)s
        N(
   R   R   R   t   propst   _oxt   _oyR   t   Affine2Dt   _shadow_transformt   _update(   R   R   t   oxt   oyR   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   L  s    		c         C` s   |  j  |  j  |  j t j |  j j t j   |  j d  k	 rU |  j	 |  j  n t
 j |  j j    \ } } } } d } | | } | | } | | } |  j | | | d f  |  j | | | d f  |  j d  d  S(   Ng333333?g      ?(   R[   R   t
   set_zordert   npt	   nextafterR   t   infR   R   R6   R   R!   Rf   R)   R(   Rz   (   R   t   rt   gR   t   at   rho(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   ^  s    #$


c         C` sA   | j  |  j  } | j  |  j  } |  j j   j | |  d  S(   N(   t   points_to_pixelsR   R   R   t   cleart	   translate(   R   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _update_transformq  s    c         C` s   |  j  S(   N(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_oxv  s    c         C` s   | |  _  d  S(   N(   R   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_oxy  s    c         C` s   |  j  S(   N(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_oy|  s    c         C` s   | |  _  d  S(   N(   R   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_oy  s    c         C` s   |  j  j   S(   N(   R   RC   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` s   |  j  j   |  j S(   N(   R   Rc   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc     s    c         C` s!   |  j  |  t j |  |  d  S(   N(   R   R   R   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    N(   R   R   R   R	   t   dedent_interpdR   R   R   R   R   R   R   R   RC   Rc   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   H  s   									t	   Rectanglec           B` s   e  Z d  Z d   Z e j d d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e e e  Z RS(   uz   
    Draw a rectangle with lower left at *xy* = (*x*, *y*) with
    specified *width*, *height* and rotation *angle*.
    c         C` s2   |  j  |  j |  j |  j |  j f } d } | | S(   Nu5   Rectangle(xy=(%g, %g), width=%g, height=%g, angle=%g)(   t   _x0t   _y0t   _widtht   _heightt   angle(   R   t   parst   fmt(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    $g        c         K` s   t  j |  |  | d |  _ | d |  _ | |  _ | |  _ |  j |  j |  _ |  j |  j |  _ t |  |  _	 t
 j   |  _ d S(   u  
        Parameters
        ----------
        xy: length-2 tuple
            The bottom and left rectangle coordinates
        width:
            Rectangle width
        height:
            Rectangle height
        angle: float, optional
          rotation in degrees anti-clockwise about *xy* (default is 0.0)
        fill: bool, optional
            Whether to fill the rectangle (default is ``True``)

        Notes
        -----
        Valid kwargs are:
        %(Patch)s
        i    i   N(   R   R   R   R   R   R   t   _x1t   _y1Rx   R   R   R3   t   _rect_transform(   R   t   xyt   widtht   heightR   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    		c         C` s
   t  j   S(   u6   
        Return the vertices of the rectangle
        (   R   t   unit_rectangle(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` sz   |  j    \ } } } } t j j | | | |  } t j   } | j | | |  j  t j |  |  _ |  j | 7_ d S(   u  NOTE: This cannot be called until after this has been added
                 to an Axes, otherwise unit conversion will fail. This
                 makes it very important to call the accessor method and
                 not directly access the transformation member variable.
        N(	   t   _convert_unitsR   t   Bboxt   from_extentsR   t   rotate_deg_aroundR   t   BboxTransformToR   (   R   t   x0t   y0t   x1t   y1t   bboxt	   rot_trans(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _update_patch_transform  s    c         C` s   |  j  |  j |  _ d  S(   N(   R   R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   _update_x1  s    c         C` s   |  j  |  j |  _ d  S(   N(   R   R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   _update_y1  s    c         C` sX   |  j  |  j  } |  j |  j  } |  j  |  j  } |  j |  j  } | | | | f S(   u1   
        Convert bounds of the rectangle
        (   t   convert_xunitsR   t   convert_yunitsR   R   R   (   R   R   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s
    c         C` s   |  j    |  j S(   N(   R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc     s    
c         C` s   |  j  S(   u&   Return the left coord of the rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_x  s    c         C` s   |  j  S(   u(   Return the bottom coord of the rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_y  s    c         C` s   |  j  |  j f S(   u2   Return the left and bottom coords of the rectangle(   R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_xy  s    c         C` s   |  j  S(   u!   Return the width of the rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   get_width  s    c         C` s   |  j  S(   u"   Return the height of the rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   get_height  s    c         C` s    | |  _  |  j   t |  _ d S(   u#   Set the left coord of the rectangleN(   R   R   R#   Ri   (   R   RS   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_x  s    	
c         C` s    | |  _  |  j   t |  _ d S(   u%   Set the bottom coord of the rectangleN(   R   R   R#   Ri   (   R   RT   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_y  s    	
c         C` s3   | \ |  _  |  _ |  j   |  j   t |  _ d S(   uc   
        Set the left and bottom coords of the rectangle

        ACCEPTS: 2-item sequence
        N(   R   R   R   R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_xy  s    

c         C` s    | |  _  |  j   t |  _ d S(   u   Set the width of the rectangleN(   R   R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   set_width  s    	
c         C` s    | |  _  |  j   t |  _ d S(   u   Set the height of the rectangleN(   R   R   R#   Ri   (   R   t   h(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_height  s    	
c         G` s   t  |  d k r+ | d \ } } } } n | \ } } } } | |  _ | |  _ | |  _ | |  _ |  j   |  j   t |  _ d S(   uj   
        Set the bounds of the rectangle: l,b,w,h

        ACCEPTS: (left, bottom, width, height)
        i    N(	   R5   R   R   R   R   R   R   R#   Ri   (   R   t   argst   lR   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_bounds  s    				

c         C` s1   |  j    \ } } } } t j j | | | |  S(   N(   R   R   R   R   (   R   R   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_bbox-  s    (   R   R   R   R   R	   R   R   RC   R   R   R   R   Rc   R   R   R   R   R   R   R   R   R   R  R  R  R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s.   	$					
													t   RegularPolygonc           B` s   e  Z d  Z d   Z e j d d d   Z d   Z d   Z d   Z	 e
 e e	  Z d   Z d	   Z e
 e e  Z d
   Z d   Z e
 e e  Z d   Z d   Z e
 e e  Z d   Z d   Z RS(   u"   
    A regular polygon patch.
    c         C` s"   d |  j  |  j d |  j d f S(   Nu   Poly%d(%g,%g)i    i   (   t   _numVerticest   _xy(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   8  s    i   i    c         K` sc   | |  _  | |  _ | |  _ | |  _ t j |  |  _ t j   |  _	 |  j
   t j |  |  d S(   uf  
        Constructor arguments:

        *xy*
          A length 2 tuple (*x*, *y*) of the center.

        *numVertices*
          the number of vertices.

        *radius*
          The distance from the center to each of the vertices.

        *orientation*
          rotates the polygon (in radians).

        Valid kwargs are:
        %(Patch)s
        N(   R	  R  t   _orientationRN   R   t   unit_regular_polygont   _pathR   R   t   _poly_transformR   R   R   (   R   R   t   numVerticesRM   t   orientationRA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   ;  s    				
c         C` s5   |  j  j   j |  j  j |  j  j |  j   d  S(   N(   R  R   t   scaleRM   t   rotateR  R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   Z  s    c         C` s   |  j  S(   N(   R	  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_xy`  s    c         C` s   | |  _  |  j   d  S(   N(   R	  R   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_xyc  s    	c         C` s   |  j  S(   N(   R
  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_orientationh  s    c         C` s   | |  _  |  j   d  S(   N(   R
  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_orientationk  s    	c         C` s   |  j  S(   N(   RN   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_radiusp  s    c         C` s   | |  _  |  j   d  S(   N(   RN   R   (   R   RM   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_radiuss  s    	c         C` s   |  j  S(   N(   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_numverticesx  s    c         C` s   | |  _  d  S(   N(   R  (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _set_numvertices{  s    c         C` s   |  j  S(   N(   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` s   |  j    |  j S(   N(   R   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc     s    
(   R   R   R   R   R	   R   R   R   R  R  R   R   R  R  R  R  R  RM   R  R  t   numverticesRC   Rc   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  4  s&   											t	   PathPatchc           B` s8   e  Z d  Z e Z d   Z e j d    Z d   Z	 RS(   u)   
    A general polycurve path patch.
    c         C` s   d t  |  j j d  S(   Nu   Poly((%g, %g) ...)i    (   t   tupleR  t   vertices(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         K` s   t  j |  |  | |  _ d S(   u   
        *path* is a :class:`matplotlib.path.Path` object.

        Valid kwargs are:
        %(Patch)s

        .. seealso::

            :class:`Patch`
                For additional kwargs

        N(   R   R   R  (   R   RF   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         C` s   |  j  S(   N(   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    (
   R   R   R   R#   Rl   R   R	   R   R   RC   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s
   	t   Polygonc           B` sz   e  Z d  Z d   Z e j e d   Z d   Z d   Z	 d   Z
 d   Z d   Z e Z e Z e e e d	 d  Z RS(
   u"   
    A general polygon patch.
    c         C` s   d t  |  j j d  S(   Nu   Poly((%g, %g) ...)i    (   R  R  R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         K` s*   t  j |  |  | |  _ |  j |  d S(   u0  
        *xy* is a numpy array with shape Nx2.

        If *closed* is *True*, the polygon will be closed so the
        starting and ending points are the same.

        Valid kwargs are:
        %(Patch)s

        .. seealso::

            :class:`Patch`
                For additional kwargs

        N(   R   R   t   _closedR   (   R   R   t   closedRA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    	c         C` s   |  j  S(   u   
        Get the path of the polygon

        Returns
        -------
        path : Path
           The :class:`~matplotlib.path.Path` object for
           the polygon
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    
c         C` s   |  j  S(   u   
        Returns if the polygon is closed

        Returns
        -------
        closed : bool
            If the path is closed
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   get_closed  s    	c         C` sH   |  j  t |  k r d St |  |  _  |  j |  j    t |  _ d S(   u   
        Set if the polygon is closed

        Parameters
        ----------
        closed : bool
           True if the polygon is closed
        N(   R  R   R   R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_closed  s
    	c         C` s
   |  j  j S(   u   
        Get the vertices of the path

        Returns
        -------
        vertices : numpy array
            The coordinates of the vertices as a Nx2
            ndarray.
        (   R  R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    
c         C` s   t  j |  } |  j r` t |  r | d | d k j   r t  j | | d g g  } q n9 t |  d k r | d | d k j   r | d  } n  t | d |  j |  _ t	 |  _
 d S(   u   
        Set the vertices of the polygon

        Parameters
        ----------
        xy : numpy array or iterable of pairs
            The coordinates of the vertices as a Nx2
            ndarray or iterable of pairs.
        i    ii   R   N(   R   t   asarrayR  R5   t   anyt   concatenatet   allR   R  R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    
	&",u  Set/get the vertices of the polygon.  This property is
           provided for backward compatibility with matplotlib 0.91.x
           only.  New code should use
           :meth:`~matplotlib.patches.Polygon.get_xy` and
           :meth:`~matplotlib.patches.Polygon.set_xy` instead.N(   R   R   R   R   R	   R   R#   R   RC   R!  R"  R   R   R  R  R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   							t   Wedgec           B` sk   e  Z d  Z d   Z e j d
 d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z RS(   u   
    Wedge shaped patch.
    c         C` s@   |  j  d |  j  d |  j |  j |  j |  j f } d } | | S(   Ni    i   u<   Wedge(center=(%g, %g), r=%g, theta1=%g, theta2=%g, width=%s)(   t   centerR   t   theta1t   theta2R   (   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         K` s\   t  j |  |  | |  _ | | |  _ |  _ | | |  _ |  _ t j   |  _	 |  j
   d S(   u(  
        Draw a wedge centered at *x*, *y* center with radius *r* that
        sweeps *theta1* to *theta2* (in degrees).  If *width* is given,
        then a partial wedge is drawn from inner radius *r* - *width*
        to outer radius *r*.

        Valid kwargs are:

        %(Patch)s
        N(   R   R   R(  R   R   R)  R*  R   R3   t   _patch_transformt   _recompute_path(   R   R(  R   R)  R*  R   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    	c   	      C` s  t  |  j |  j d  d k r8 d \ } } t j } n |  j |  j } } t j } t j | |  } |  j d  k	 r| j	 } | j	 d  d  d  |  j
 |  j |  j
 } t j | | | d d  d   f d g  } t j | j | j | t j g  } | | t | j  <nX t j | j	 d | j	 d d  d   f d g g  } t j | j | | t j g g  } | |  j
 9} | t j |  j  7} t | |  |  _ d  S(	   Nih  g-q=i    i(   i    ih  (   i    i    (   i    i    (   i    i    (   t   absR*  R)  R   t   MOVETOt   LINETOt   arcR   R   R  R   R   t   vstackt   hstackt   codest	   CLOSEPOLYR5   R#  R(  R  (	   R   R)  R*  t	   connectorR0  t   v1t   v2t   vRw   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR,  0  s"     		++$4$c         C` s   d  |  _ | |  _ t |  _ d  S(   N(   R   R  R(  R#   Ri   (   R   R(  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_centerN  s    		c         C` s   d  |  _ | |  _ t |  _ d  S(   N(   R   R  R   R#   Ri   (   R   RM   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_radiusS  s    		c         C` s   d  |  _ | |  _ t |  _ d  S(   N(   R   R  R)  R#   Ri   (   R   R)  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_theta1X  s    		c         C` s   d  |  _ | |  _ t |  _ d  S(   N(   R   R  R*  R#   Ri   (   R   R*  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_theta2]  s    		c         C` s   d  |  _ | |  _ t |  _ d  S(   N(   R   R  R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   b  s    		c         C` s#   |  j  d  k r |  j   n  |  j  S(   N(   R  R   R,  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC   g  s    N(   R   R   R   R   R	   R   R   R   R,  R9  R:  R;  R<  R   RC   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR'    s   							t   Arrowc        
   B` s   e  Z d  Z d   Z e d d g d d g d d g d d g d d g d d g d d g d d g g d	 e Z e j d d
   Z	 d   Z
 d   Z RS(   u   
    An arrow patch.
    c         C` s   d S(   Nu   Arrow()(    (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   r  s    g        g?gg?g333333ӿg      ?g333333?R   c         K` s   t  j |  |  t j | |  } | d k rE | | } | | }	 n d \ } }	 t j   j | |  }
 t j j | |	 |	 | d d  } t j   j | |  } |
 | | } | j	   |  _
 d S(   u  
        Draws an arrow from (*x*, *y*) to (*x* + *dx*, *y* + *dy*).
        The width of the arrow is scaled by *width*.

        Parameters
        ----------
        x : scalar
            x coordinate of the arrow tail
        y : scalar
            y coordinate of the arrow tail
        dx : scalar
            Arrow length in the x direction
        dy : scalar
            Arrow length in the y direction
        width : scalar, optional (default: 1)
            Scale factor for the width of the arrow. With a default value of
            1, the tail width is 0.2 and head width is 0.6.
        **kwargs :
            Keyword arguments control the :class:`~matplotlib.patches.Patch`
            properties:

            %(Patch)s

        See Also
        --------
        :class:`FancyArrow` :
            Patch that allows independent control of the head and tail
            properties
        i    i   g        N(   i    i   (   R   R   R   t   hypotR   R   R  t   from_valuesR   t   frozenR+  (   R   RS   RT   t   dxt   dyR   RA   t   Lt   cxt   sxt   trans1t   trans2t   trans3RE   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   {  s    
"c         C` s   |  j  S(   N(   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` s   |  j  S(   N(   R+  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc     s    (   R   R   R   R   R   R#   R  R	   R   R   RC   Rc   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR=  n  s   		.	t
   FancyArrowc        	   B` sD   e  Z d  Z e Z d   Z e j d e d d d d e d   Z
 RS(   uP   
    Like Arrow, but lets you set head width and head height independently.
    c         C` s   d S(   Nu   FancyArrow()(    (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    gMbP?u   fulli    c         K` s.  | d k r d | } n  | d k r2 d | } n  t j | |  } | rS | } n
 | | } | sl g  } n| | |
 | f \ } } } } t j d d g | | d g | d | | d g | | d g | d g g  } | s | | d g 7} n  | r| | d d g 7} n  |	 d k r,| } nj | d d g } |	 d	 k rQ| } nE |	 d
 k rt j | d  | d d d  g  } n t d |	   | d k r| | } | | } n d \ } } | | g | | g g } t j | |  | | | | f } t j |  t	 t
 t |   d t | d S(   u  
        Constructor arguments
          *width*: float (default: 0.001)
            width of full arrow tail

          *length_includes_head*: bool (default: False)
            True if head is to be counted in calculating the length.

          *head_width*: float or None (default: 3*width)
            total width of the full arrow head

          *head_length*: float or None (default: 1.5 * head_width)
            length of arrow head

          *shape*: ['full', 'left', 'right'] (default: 'full')
            draw the left-half, right-half, or full arrow

          *overhang*: float (default: 0)
            fraction that the arrow is swept back (0 overhang means
            triangular shape). Can be negative or greater than one.

          *head_starts_at_zero*: bool (default: False)
            if True, the head starts being drawn at coordinate 0
            instead of ending at coordinate 0.

        Other valid kwargs (inherited from :class:`Patch`) are:
        %(Patch)s

        i   g      ?g        g       @i   i    u   leftiu   rightu   fulliNu   Got unknown shape: %sR   (   i    i   (   R   R   R>  t   arrayR%  R   t   dotR  R   t   listR   R  R#   (   R   RS   RT   RA  RB  R   t   length_includes_headt
   head_widtht   head_lengtht   shapet   overhangt   head_starts_at_zeroRA   t   distancet   lengtht   vertst   hwt   hlt   hsR   t   left_half_arrowt   coordst   right_half_arrowRD  RE  t   M(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     sJ    !	
				
$N(   R   R   R   R#   Rl   R   R	   R   Rm   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRI    s   	t   YAArrowc           B` sM   e  Z d  Z d   Z e j d d d d   Z d   Z d   Z d   Z	 RS(	   u   
    Yet another arrow class.

    This is an arrow that is defined in display space and has a tip at
    *x1*, *y1* and a base at *x2*, *y2*.
    c         C` s   d S(   Nu	   YAArrow()(    (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    i   g?i   c         K` sJ   | |  _  | |  _ | |  _ | |  _ | |  _ t j |  |  | |  _ d S(   u  
        Constructor arguments:

        *xytip*
          (*x*, *y*) location of arrow tip

        *xybase*
          (*x*, *y*) location the arrow base mid point

        *figure*
          The :class:`~matplotlib.figure.Figure` instance
          (fig.dpi)

        *width*
          The width of the arrow in points

        *frac*
          The fraction of the arrow length occupied by the head

        *headwidth*
          The width of the base of the arrow head in points

        Valid kwargs are:
        %(Patch)s

        N(   t   xytipt   xybaseR   t   fract	   headwidthR   R   t   figure(   R   Rb  R^  R_  R   R`  Ra  RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   !  s    					c      	   C` s  |  j  \ } } |  j \ } } |  j |  j j d d } |  j |  j j d d } |  j | | | | |  \ } } }	 }
 t j | | | |  } t j	 | | d | | d  } | |  j
 | t j |  } | |  j
 | t j |  } |  j | | | | |  \ } } } } |  j | | | | |  \ } } } } |  j | |	 | | | | | | g  } |  j | |
 | | | | | | g  } t t j | | g  d t S(   Ng      R@g       @R   (   R^  R_  R   Rb  t   dpiRa  t	   getpointst   matht   atan2t   sqrtR`  t   cost   sinR   R   R   R   t   column_stackR#   (   R   R   R   t   x2t   y2t   k1t   k2t   xb1t   yb1t   xb2t   yb2t   thetaR   t   xmt   ymt   xc1t   yc1t   xc2t   yc2t   xd1t   yd1t   xd2t   yd2t   xst   ys(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC   H  s    '#''''c         C` s
   t  j   S(   N(   R   R3   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc   `  s    c         C` s[  t  t | | | | | f  \ } } } } } | | d k rU | | | | | | f S| | d k r} | | | | | | f S| | | | } d | } d } d | }	 | d | d | d d | d }
 |	 t j |	 d d | |
  d | } | | | | } |	 t j |	 d d | |
  d | } | | | | } | | | | f S(	   u  
        For line segment defined by (*x1*, *y1*) and (*x2*, *y2*)
        return the points on the line that is perpendicular to the
        line and intersects (*x2*, *y2*) and the distance from (*x2*,
        *y2*) of the returned points is *k*.
        i    g      i   ig       @g      ?i   i   (   R   Rx   Re  Rg  (   R   R   R   Rk  Rl  t   kt   mt   pmR   R   Rw   t   y3at   x3at   y3bt   x3b(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRd  c  s    -

&,,(
   R   R   R   R   R	   R   R   RC   Rc   Rd  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR]    s   	%		t   CirclePolygonc           B` s/   e  Z d  Z d   Z e j d d d   Z RS(   u4   
    A polygon-approximation of a circle patch.
    c         C` s   d |  j  S(   Nu   CirclePolygon(%d,%d)(   R(  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    i   i   c         K` s#   t  j |  | | | d d | d S(   u/  
        Create a circle at *xy* = (*x*, *y*) with given *radius*.
        This circle is approximated by a regular polygon with
        *resolution* sides.  For a smoother circle drawn with splines,
        see :class:`~matplotlib.patches.Circle`.

        Valid kwargs are:
        %(Patch)s

        R  i    N(   R  R   (   R   R   RM   t
   resolutionRA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s
    (   R   R   R   R   R	   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s
   	t   Ellipsec           B` sG   e  Z d  Z d   Z e j d d   Z d   Z d   Z d   Z	 RS(   u   
    A scale-free ellipse.
    c         C` s:   |  j  d |  j  d |  j |  j |  j f } d } | | S(   Ni    i   u3   Ellipse(xy=(%s, %s), width=%s, height=%s, angle=%s)(   R(  R   R   R   (   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    g        c         K` sW   t  j |  |  | |  _ | | |  _ |  _ | |  _ t j   |  _ t	 j
   |  _ d S(   u*  
        *xy*
          center of ellipse

        *width*
          total length (diameter) of horizontal axis

        *height*
          total length (diameter) of vertical axis

        *angle*
          rotation in degrees (anti-clockwise)

        Valid kwargs are:
        %(Patch)s
        N(   R   R   R(  R   R   R   R   t   unit_circleR  R   R3   R+  (   R   R   R   R   R   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    		c         C` s   |  j  |  j d  |  j |  j d  f } |  j  |  j  } |  j |  j  } t j   j | d | d  j |  j	  j
 |   |  _ d S(   u  NOTE: This cannot be called until after this has been added
                 to an Axes, otherwise unit conversion will fail. This
                 makes it very important to call the accessor method and
                 not directly access the transformation member variable.
        i    i   g      ?N(   R   R(  R   R   R   R   R   R  t
   rotate_degR   R   R+  (   R   R(  R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _recompute_transform  s    c         C` s   |  j  S(   u6   
        Return the vertices of the rectangle
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` s   |  j    |  j S(   N(   R  R+  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRc     s    
(
   R   R   R   R   R	   R   R   R  RC   Rc   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   			t   Circlec           B` sM   e  Z d  Z d   Z e j d d   Z d   Z d   Z e	 e e  Z
 RS(   u   
    A circle patch.
    c         C` s.   |  j  d |  j  d |  j f } d } | | S(   Ni    i   u   Circle(xy=(%g, %g), radius=%g)(   R(  RM   (   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s     i   c         K` s.   t  j |  | | d | d |  | |  _ d S(   u7  
        Create true circle at center *xy* = (*x*, *y*) with given
        *radius*.  Unlike :class:`~matplotlib.patches.CirclePolygon`
        which is a polygonal approximation, this uses Bézier splines
        and is much closer to a scale-free circle.

        Valid kwargs are:
        %(Patch)s

        i   N(   R  R   RM   (   R   R   RM   RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    !c         C` s!   d | |  _  |  _ t |  _ d S(   uF   
        Set the radius of the circle

        ACCEPTS: float
        i   N(   R   R   R#   Ri   (   R   RM   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR:    s    c         C` s   |  j  d S(   u   return the radius of the circleg       @(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   get_radius  s    (   R   R   R   R   R	   R   R   R:  R  R   RM   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   				t   Arcc           B` sD   e  Z d  Z d   Z e j d d d d   Z e j d    Z	 RS(   us  
    An elliptical arc.  Because it performs various optimizations, it
    can not be filled.

    The arc must be used in an :class:`~matplotlib.axes.Axes`
    instance---it can not be added directly to a
    :class:`~matplotlib.figure.Figure`---because it is optimized to
    only render the segments that are inside the axes bounding box
    with high resolution.
    c         C` sF   |  j  d |  j  d |  j |  j |  j |  j |  j f } d } | | S(   Ni    i   uE   Arc(xy=(%g, %g), width=%g, height=%g, angle=%g, theta1=%g, theta2=%g)(   R(  R   R   R   R)  R*  (   R   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    g        g     v@c   	      K` sY   | j  d t  } | r' t d   n  t j |  | | | | |  | |  _ | |  _ d S(   u  
        The following args are supported:

        *xy*
          center of ellipse

        *width*
          length of horizontal axis

        *height*
          length of vertical axis

        *angle*
          rotation in degrees (anti-clockwise)

        *theta1*
          starting angle of the arc in degrees

        *theta2*
          ending angle of the arc in degrees

        If *theta1* and *theta2* are not provided, the arc will form a
        complete ellipse.

        Valid kwargs are:

        %(Patch)s
        u   fillu   Arc objects can not be filledN(   t
   setdefaultRm   R   R  R   R)  R*  (	   R   R   R   R   R   R)  R*  RA   R>   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    	c         ` s  t  |  d  s t d   n  |  j   |  j |  j  } |  j |  j  } d   } | |  j | |  } | |  j | |  } |  j	   j
 | | f  \ } } d } | | k  r | | k  r t j | |  |  _ t j |  |  Sd       f d   } t j   }	 t j |  j j  |  j	   j   }
 |	 j |
  }	 t   } x t |	 j d	  |	 j d
  D] \ } } | \ } } | \ } } x | | | | |  D]v \ } } t j |  } | d k  rd t j | } n  t j |  } | | k  o| k  n r| j |  qqWqdWt |  | g } | } t j  |  } |	 j! t j" |  t j# |  f  } |  j } xQ | D]I } | rt j | | d  |  _ t j |  |  t$ } n t% } | } q{W| |  _ d S(   u  
        Ellipses are normally drawn using an approximation that uses
        eight cubic bezier splines.  The error of this approximation
        is 1.89818e-6, according to this unverified source:

          Lancaster, Don.  Approximating a Circle or an Ellipse Using
          Four Bezier Cubic Splines.

          http://www.tinaja.com/glib/ellipse4.pdf

        There is a use case where very large ellipses must be drawn
        with very high accuracy, and it is too expensive to render the
        entire ellipse with enough segments (either splines or line
        segments).  Therefore, in the case where either radius of the
        ellipse is large enough that the error of the spline
        approximation will be visible (greater than one pixel offset
        from the ideal), a different technique is used.

        In that case, only the visible parts of the ellipse are drawn,
        with each visible arc using a fixed number of spline segments
        (8).  The algorithm proceeds as follows:

          1. The points where the ellipse intersects the axes bounding
             box are located.  (This is done be performing an inverse
             transformation on the axes bbox such that it is relative
             to the unit circle -- this makes the intersection
             calculation much easier than doing rotated ellipse
             intersection directly).

             This uses the "line intersecting a circle" algorithm
             from:

               Vince, John.  Geometry for Computer Graphics: Formulae,
               Examples & Proofs.  London: Springer-Verlag, 2005.

          2. The angles of each of the intersection points are
             calculated.

          3. Proceeding counterclockwise starting in the positive
             x-direction, each of the visible arc-segments between the
             pairs of vertices are drawn using the bezier arc
             approximation technique implemented in
             :meth:`matplotlib.path.Path.arc`.
        u   axesu'   Arcs can only be used in Axes instancesc         S` sJ   t  j |   }  t  j |   } t  j |   } t  j t  j | | |   S(   N(   R   t   deg2radRh  Ri  t   rad2degt   arctan2(   Rs  R  RS   RT   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   theta_stretcht  s    g      ?gJؿ>g      ?c         s` s  | |  } | | } | | | | } |  | | | } | | } | | }	 |	 d k r | | | }
 | | | } |
 | f Vn |	 d k r| d k  r d } n d } t  j |	  } x^ d D]S } | | | | | | | }
 | | | t  j |  | | } |
 | f Vq Wn  d  S(   Ng        g      g      ?(   g      ?g      (   R   Rg  R-  (   R   R   R   R   RA  RB  t   dr2t   Dt   D2t   discrimRS   RT   t   sign_dyt   sqrt_discrimt   sign(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   iter_circle_intersect_on_line  s&    



	$c         3` s   d } | |  k  r" | |  } } n |  | } } | | k  rK | | } } n | | } } | | 8} | | 8} | | 7} | | 7} xa   |  | | |  D]J \ }	 }
 |	 | k r |	 | k r |
 | k r |
 | k r |	 |
 f Vq q Wd  S(   Ng&.>(    (   R   R   R   R   t   epsilont   x0et   x1et   y0et   y1eRS   RT   (   R  (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt!   iter_circle_intersect_on_line_seg  s    



"0ii   i    i   i   Ng\! Ag\!A(&   t   hasattrt   RuntimeErrorR  R   R   R   R   R)  R*  RB   t   transform_pointR   R0  R  R   R   R   R   R   t   axesR   t   invertedt   transformedt   setR   R  R   t   arccost   piR  t   addt   sortedR  RR   Rh  Ri  Rm   R#   (   R   R   R   R   R  R)  R*  t	   inv_errorR  t   box_patht   box_path_transformt   thetast   p0t   p1R   R   R   R   RS   RT   Rs  t
   last_thetat
   theta1_radRV   t   path_original(    (   R  s1   lib/python2.7/site-packages/matplotlib/patches.pyR   <  sX    .
	!		*"		
(
   R   R   R   R   R	   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   
	&c      	   C` s   | d k r i  } n  | j   } | j d d  } | j |  } |  j |  } | j \ } } } }	 | | d 8} | | d 8} | | 7} |	 | 7}	 t d | | f d | d |	 d |  }
 |
 j t j	    |
 j
 t  |
 j |  |
 j |  d S(	   ud  
    This is a debug function to draw a rectangle around the bounding
    box returned by
    :meth:`~matplotlib.artist.Artist.get_window_extent` of an artist,
    to test whether the artist is returning the correct bbox.

    *props* is a dict of rectangle props with the additional property
    'pad' that sets the padding around the bbox in points.
    u   padi   g       @R   R   R   R>   N(   R   t   copyt   popR   R   t   boundsR   R_   R   R3   t   set_clip_onRm   R6   R   (   R   R   R   R>   t   padR   R  R   R   R  R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   bbox_artist  s&    
	

	u   kc   	      C` s|   |  j  \ } } } } t d | | f d | d | d | d t  } | d k	 r^ | j |  n  | j t  | j |  d S(   u   
    This is a debug function to draw a rectangle around the bounding
    box returned by
    :meth:`~matplotlib.artist.Artist.get_window_extent` of an artist,
    to test whether the artist is returning the correct bbox.
    R   R   R   R7   R>   N(   R  R   Rm   R   R_   R  R   (	   R   R   R9   RE   R  R   R   R  R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   draw_bbox  s    	i   c      	   C` s  | r d | } n d } g  |  d D] } g  ^ q$ } x; |  D]3 } x* t  | |  D] \ } } | j |  qS Wq= Wg  | D] } t d   | D  ^ q{ } g  } | d j g  | D] }	 d |	 ^ q  }
 | j d  | j |
  | j | d j g  t  |  d |  D] \ } }	 | j |	  ^ q
  | j |
  | j g  |  d D]D } | d j g  t  | |  D] \ } }	 | j |	  ^ qm ^ qN | j |
  | j d  d j |  S(	   uR   
    Given the list of list of strings, return a string of REST table format.
    u    u    i    c         s` s   |  ] } t  |  Vq d  S(   N(   R5   (   t   .0t   cell(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pys	   <genexpr>  s    u      u   =i   u   
(   R   t   appendt   maxt   joint   ljustt   extend(   t   _tablet   leadingspaceR  R  t   columnst   rowt   columnt   col_lenR
   t   clt   table_formatstr(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _pprint_table  s(    )*7	Sc         C` sA  d d l  } d d d g g } xt |  j    D]\ } } t j rg | j | j  \ } } } } n' | j | j  \ } } } } }	 }
 } | r g  t | d |  D] \ } } | | f ^ q } n d } | d k r d } n2 d j
 g  | D] \ } } d	 | | f ^ q  } | j | j d
 | | g  q1 Wt |  S(   u   
    A helper function for the _Style class.  Given the dictionary of
    (stylename : styleclass), return a formatted string listing all the
    styles. Used to update the documentation.
    i    Nu   Classu   Nameu   Attrsi   u   Noneu   ,u   %s=%su   ``%s``(   t   inspectR  t   itemst   sixt   PY2t
   getargspecR   t   getfullargspecR   R   R  R  R   R  (   t   _stylesR  R  t   namet   clsR  t   varargst   varkwt   defaultst
   kwonlyargst
   kwonlydefst   annotationst   argnamet
   argdefaultt   argstrt   ant   av(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _pprint_styles4  s     	!'2		)!c         C` s(   d j  d j t d j  t |      S(   u   
    A helper function for the _Style class.  Given the dictionary of
    (stylename : styleclass), return a string rep of the list of keys.
    Used to update the documentation.
    u   [{}]u   |u    '{}' (   t   formatR  R   R  (   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _simpleprint_stylesW  s    t   _Stylec           B` sD   e  Z d  Z d   Z e d    Z e d    Z e d    Z RS(   u   
    A base class for the Styles. It is meant to be a container class,
    where actual styles are declared as subclass of it, and it
    provides some helper functions.
    c   	      K` s   | j  d d  j d  } | d j   } y |  j | } Wn! t k
 r_ t d |   n Xy: g  | d D] } | j d  ^ qn } d   | D } Wn! t k
 r t d	 |   n X| j |  | |   S(
   uP   
        return the instance of the subclass with the given style name.
        u    u    u   ,i    u   Unknown style : %si   u   =c         S` s%   i  |  ] \ } } t  |  |  q S(    (   Rx   (   R  R  R8  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pys
   <dictcomp>w  s   	 u   Incorrect style argument : %s(   t   replaceR   R   t   _style_listt   KeyErrorR   R6   (	   R   t	   stylenamet   kwt   _listt   _namet   _clst   cst
   _args_pairt   _args(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   __new__f  s    &c         C` s   |  j  S(   uP   
        A class method which returns a dictionary of available styles.
        (   R  (   t   klass(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   get_styles~  s    c         C` s   t  |  j  S(   uP   
        A class method which returns a string of the available styles.
        (   R  R  (   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   pprint_styles  s    c         C` s?   t  | |  j  s. t d | |  j f   n  | |  j | <d S(   u'   
        Register a new style.
        u   %s must be a subclass of %sN(   t
   issubclasst   _BaseR   R  (   R  R  t   style(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   register  s    	(   R   R   R   R  t   classmethodR  R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  `  s
   	t   BoxStylec           B` ss  e  Z d  Z i  Z d e f d     YZ d e f d     YZ e e d <d e f d     YZ e e d <d	 e f d
     YZ e e d <d e f d     YZ	 e	 e d <d e f d     YZ
 e
 e d <d e f d     YZ e e d <d e f d     YZ e e d <d e f d     YZ e e d <d e f d     YZ e e d <e rqe j e  i e e  d 6Z n  RS(   u  
    :class:`BoxStyle` is a container class which defines several
    boxstyle classes, which are used for :class:`FancyBboxPatch`.

    A style object can be created as::

           BoxStyle.Round(pad=0.2)

    or::

           BoxStyle("Round", pad=0.2)

    or::

           BoxStyle("Round, pad=0.2")

    Following boxstyle classes are defined.

    %(AvailableBoxstyles)s

    An instance of any boxstyle class is an callable object,
    whose call signature is::

       __call__(self, x0, y0, width, height, mutation_size, aspect_ratio=1.)

    and returns a :class:`Path` instance. *x0*, *y0*, *width* and
    *height* specify the location and size of the box to be
    drawn. *mutation_scale* determines the overall size of the
    mutation (by which I mean the transformation of the rectangle to
    the fancy box).  *mutation_aspect* determines the aspect-ratio of
    the mutation.
    R  c           B` s5   e  Z d  Z d   Z d   Z d d  Z d   Z RS(   u_  
        :class:`BBoxTransmuterBase` and its derivatives are used to make a
        fancy box around a given rectangle. The :meth:`__call__` method
        returns the :class:`~matplotlib.path.Path` of the fancy box. This
        class is not an artist and actual drawing of the fancy box is done
        by the :class:`FancyBboxPatch` class.
        c         C` s   t  t j |   j   d S(   u(   
            initializtion.
            N(   t   superR  R  R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         C` s   t  d   d S(   u  
            The transmute method is a very core of the
            :class:`BboxTransmuter` class and must be overridden in the
            subclasses. It receives the location and size of the
            rectangle, and the mutation_size, with which the amount of
            padding and etc. will be scaled. It returns a
            :class:`~matplotlib.path.Path` instance.
            u   Derived must overrideN(   R   (   R   R   R   R   R   t   mutation_size(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   transmute  s    	g      ?c   
      C` s   | d k	 r | | | | } } |  j | | | | |  } | j | j } }	 | d d  d f | | d d  d f <t | |	  S|  j | | | | |  Sd S(   uH  
            Given the location and size of the box, return the path of
            the box around it.

              - *x0*, *y0*, *width*, *height* : location and size of the box
              - *mutation_size* : a reference scale for the mutation.
              - *aspect_ratio* : aspect-ration for the mutation.
            Ni   (   R   R  R  R3  R   (
   R   R   R   R   R   R  t   aspect_ratioRF   R  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   __call__  s    *c         C` s"   t  j   t |  j j f |  j f S(   N(   R   t   _NestedClassGetterR  R   R   t   __dict__(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   __reduce__  s    	(   R   R   R   R   R  R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s
   		t   Squarec           B` s#   e  Z d  Z d d  Z d   Z RS(   u&   
        A simple square box.
        g333333?c         C` s#   | |  _  t t j |   j   d S(   uB   
             *pad*
                amount of padding
            N(   R  R  R  R  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR      s    	c         C` s   | |  j  } | d | | d | } } | | | | } } | | | | } } | | f | | f | | f | | f | | f g }	 t j g t j g d t j g }
 t |	 |
  S(   Ni   i   (   R  R   R.  R/  R4  (   R   R   R   R   R   R  R  R   R   R  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  	  s    3$(   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   	u   squareR  c           B` s#   e  Z d  Z d d  Z d   Z RS(   u   A simple circle box.g333333?c         C` s#   | |  _  t t j |   j   d S(   u   
            Parameters
            ----------
            pad : float
                The amount of padding around the original box.
            N(   R  R  R  R  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    	c         C` sr   | |  j  } | d | | d | } } | | | | } } t j | | d | | d f t | |  d  S(   Ni   (   R  R   t   circleR  (   R   R   R   R   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  %  s
    (   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   
u   circlet   LArrowc           B` s#   e  Z d  Z d d  Z d   Z RS(   u"   
        (left) Arrow Box
        g333333?c         C` s#   | |  _  t t j |   j   d  S(   N(   R  R  R  R  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   4  s    	c      
   C` sH  | |  j  } | d | | d | } } | | | | } } | | | | } } | | d }	 |	 d }
 | | d } | |
 | f | | f | | f | |
 | f | |
 | |
 f | |	 | |	 f | |
 | |
 f | |
 | f | |
 | f g	 } t j t j t j t j t j t j t j t j t j g	 } t | |  } | S(   Ng       @g      ?gffffff?(   R  R   R.  R/  R4  (   R   R   R   R   R   R  R  R   R   RA  t   dxxt   cpt   comRF   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  8  s     
," (   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  0  s   u   larrowt   RArrowc           B` s#   e  Z d  Z d d  Z d   Z RS(   u#   
        (right) Arrow Box
        g333333?c         C` s   t  t j |   j |  d  S(   N(   R  R  R	  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   [  s    c         C` s]   t  j j |  | | | | |  } d | | | j d  d   d f | j d  d   d f <| S(   Ni   i    (   R  R  R  R  (   R   R   R   R   R   R  t   p(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  ^  s    8(   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR	  V  s   u   rarrowt   DArrowc           B` s#   e  Z d  Z d d  Z d   Z RS(   u$   
        (Double) Arrow Box
        g333333?c         C` s#   | |  _  t t j |   j   d  S(   N(   R  R  R  R  R   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   p  s    	c         C` sz  | |  j  } | d | } | | | | } } | | | | } } | | d }	 |	 d }
 | | d } | |
 | f | | f | | |
 f | |	 |
 | |	 f | | |
 f | | f | |
 | f | |
 | |
 f | |	 | |	 f | |
 | |
 f | |
 | f | |
 | f g } t j t j t j t j t j t j t j t j t j t j t j t j g } t | |  } | S(   Ng       @g      ?gffffff?(   R  R   R.  R/  R4  (   R   R   R   R   R   R  R  R   R   RA  R  R  R  RF   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  t  s.    
"" (   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  i  s   u   darrowt   Roundc           B` s&   e  Z d  Z d d d  Z d   Z RS(   u+   
        A box with round corners.
        g333333?c         C` s,   | |  _  | |  _ t t j |   j   d S(   u   
            *pad*
              amount of padding

            *rounding_size*
              rounding radius of corners. *pad* if None
            N(   R  t   rounding_sizeR  R  R  R   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    		c         C` s  | |  j  } |  j r& | |  j } n | } | d | | d | } } | | | | } } | | | | } }	 | | | f | | | f | | f | | | f | |	 | f | |	 f | | |	 f | | |	 f | |	 f | |	 | f | | | f | | f | | | f | | | f g }
 t j t j t j t j t j t j t j t j t j t j t j t j t j t j g } t |
 |  } | S(   Ng       @(   R  R  R   R.  R/  t   CURVE3R4  (   R   R   R   R   R   R  R  t   drR   R   R  R  RF   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s:    	N(   R   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   roundt   Round4c           B` s&   e  Z d  Z d d d  Z d   Z RS(   u/   
        Another box with round edges.
        g333333?c         C` s,   | |  _  | |  _ t t j |   j   d S(   u   
            *pad*
              amount of padding

            *rounding_size*
              rounding size of edges. *pad* if None
            N(   R  R  R  R  R  R   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    			c         C` s  | |  j  } |  j r& | |  j } n
 | d } | d | d | | d | d | } } | | | | | | } } | | | | } }	 | | f | | | | f | | | | f | | f | | | | f | | |	 | f | |	 f | | |	 | f | | |	 | f | |	 f | | |	 | f | | | | f | | f | | f g }
 t j t j t j t j t j t j t j t j t j t j t j t j t j t j g } t |
 |  } | S(   Ng       @i   (   R  R  R   R.  t   CURVE4R4  (   R   R   R   R   R   R  R  R  R   R   R  R  RF   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s,    	
	++++N(   R   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   round4t   Sawtoothc           B` s/   e  Z d  Z d d d  Z d   Z d   Z RS(   u!   
        A sawtooth box.
        g333333?c         C` s,   | |  _  | |  _ t t j |   j   d S(   u   
            *pad*
              amount of padding

            *tooth_size*
              size of the sawtooth. pad* if None
            N(   R  t
   tooth_sizeR  R  R  R   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   	  s    		c         C` s?  | |  j  } |  j d  k r0 |  j  d | } n |  j | } | d } | d | | | d | | } } t t j | | | d   d }	 | | |	 }
 t t j | | | d   d } | | | } | | | | | | } } | | | | } } | g g  t |	 d  D] } | | |
 d | ^ q| | g } | g | | | | | | g |	 | | g } | g | | | | | | g |	 | | g } | g g  t | d  D] } | | | d | ^ q| | g } | g g  t |	 d  D] } | | |
 d | ^ q| | g } | g | | | | | | g |	 | | g } | g | | | | | | g | | | g } | g g  t | d  D] } | | | d | ^ q| | g } t t | |   t t | |   t t | |   t t | |   | d | d f g } | S(   Ng      ?g       @i   i    (	   R  R  R   t   intR   t   roundt   rangeRL  R   (   R   R   R   R   R   R  R  R  t   tooth_size2t   dsx_nt   dsxt   dsy_nt   dsyR   R   t   it   bottom_saw_xt   bottom_saw_yt   right_saw_xt   right_saw_yt	   top_saw_xt	   top_saw_yt
   left_saw_xt
   left_saw_yt   saw_vertices(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_sawtooth_vertices#	  s@    
%%7""77""7Kc         C` s1   |  j  | | | | |  } t | d t } | S(   NR   (   R&  R   R#   (   R   R   R   R   R   R  R%  RF   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  v	  s    N(   R   R   R   R   R   R&  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  	  s   	Su   sawtootht
   Roundtoothc           B` s&   e  Z d  Z d d d  Z d   Z RS(   u   A rounded tooth box.g333333?c         C` s    t  t j |   j | |  d S(   u   
            *pad*
              amount of padding

            *tooth_size*
              size of the sawtooth. pad* if None
            N(   R  R  R'  R   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   	  s    c         C` s   |  j  | | | | |  } t j t j |  | d g g d d } t j g t j t j g t |  d d t j g } t | |  S(   Ni    t   axisi   i   (	   R&  R   R%  RJ  R   R.  R  R5   R4  (   R   R   R   R   R   R  R%  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  	  s    	+N(   R   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR'  	  s   
u
   roundtoothu   AvailableBoxstyles(   R   R   R   R  t   objectR  R  R  R  R	  R  R  R  R  R'  R   t   dedentR  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s0    ?

$

1
=
5
k

t   AvailableBoxstylest   ListBoxstylest   FancyBboxPatchc           B` s   e  Z d  Z e Z d   Z e j d d d d d   Z	 e j d d   Z
 d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   u}  
    Draw a fancy box around a rectangle with lower left at *xy*=(*x*,
    *y*) with specified width and height.

    :class:`FancyBboxPatch` class is similar to :class:`Rectangle`
    class, but it draws a fancy box around the rectangle. The
    transformation of the rectangle box to the fancy box is delegated
    to the :class:`BoxTransmuterBase` and its derived classes.

    c         C` s*   |  j  j d |  j |  j |  j |  j f S(   Nu   (%g,%g;%gx%g)(   R   R   t   _xt   _yR   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   	  s    	u   roundg      ?c   	      K` s   t  j |  |  | d |  _ | d |  _ | |  _ | |  _ | d k ro | d k rc t d   n  | |  _ n |  j	 |  | |  _
 | |  _ t |  _ d S(   u  
        *xy* = lower left corner

        *width*, *height*

        *boxstyle* determines what kind of fancy box will be drawn. It
        can be a string of the style name with a comma separated
        attribute, or an instance of :class:`BoxStyle`. Following box
        styles are available.

        %(AvailableBoxstyles)s

        *mutation_scale* : a value with which attributes of boxstyle
        (e.g., pad) will be scaled. default=1.

        *mutation_aspect* : The height of the rectangle will be
        squeezed by this value before the mutation and the mutated
        box will be stretched by the inverse of it. default=None.

        Valid kwargs are:
        %(Patch)s
        i    i   u   customu7   bbox_transmuter argument is needed with custom boxstyleN(   R   R   R.  R/  R   R   R   R   t   _bbox_transmutert   set_boxstylet   _mutation_scalet   _mutation_aspectR#   Ri   (	   R   R   R   R   t   boxstylet   bbox_transmutert   mutation_scalet   mutation_aspectRA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   	  s    				c         K` s_   | d k r t j   St | t j  s4 t |  r@ | |  _ n t | |  |  _ t |  _ d S(   u  
        Set the box style.

        *boxstyle* can be a string with boxstyle name with optional
        comma-separated attributes. Alternatively, the attrs can
        be provided as keywords::

            set_boxstyle("round,pad=0.2")
            set_boxstyle("round", pad=0.2)

        Old attrs simply are forgotten.

        Without argument (or with *boxstyle* = None), it returns
        available box styles.

        The following boxstyles are available:
        %(AvailableBoxstyles)s

        ACCEPTS: %(ListBoxstyles)s

        N(	   R   R  R  t
   isinstanceR  RP   R0  R#   Ri   (   R   R4  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR1  	  s    
c         C` s   | |  _  t |  _ d S(   uA   
        Set the mutation scale.

        ACCEPTS: float
        N(   R2  R#   Ri   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_mutation_scale
  s    	c         C` s   |  j  S(   u,   
        Return the mutation scale.
        (   R2  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_mutation_scale
  s    c         C` s   | |  _  t |  _ d S(   uT   
        Set the aspect ratio of the bbox mutation.

        ACCEPTS: float
        N(   R3  R#   Ri   (   R   t   aspect(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_mutation_aspect
  s    	c         C` s   |  j  S(   u?   
        Return the aspect ratio of the bbox mutation.
        (   R3  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_mutation_aspect
  s    c         C` s   |  j  S(   u   Return the boxstyle object(   R0  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_boxstyle%
  s    c         C` s=   |  j    |  j |  j |  j |  j |  j   |  j    } | S(   u:   
        Return the mutated path of the rectangle
        (   R>  R.  R/  R   R   R:  R=  (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC   )
  s
    	c         C` s   |  j  S(   u&   Return the left coord of the rectangle(   R.  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   6
  s    c         C` s   |  j  S(   u(   Return the bottom coord of the rectangle(   R/  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   :
  s    c         C` s   |  j  S(   u"   Return the width of the  rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   >
  s    c         C` s   |  j  S(   u"   Return the height of the rectangle(   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   B
  s    c         C` s   | |  _  t |  _ d S(   uM   
        Set the left coord of the rectangle

        ACCEPTS: float
        N(   R.  R#   Ri   (   R   RS   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   F
  s    	c         C` s   | |  _  t |  _ d S(   uO   
        Set the bottom coord of the rectangle

        ACCEPTS: float
        N(   R/  R#   Ri   (   R   RT   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   O
  s    	c         C` s   | |  _  t |  _ d S(   uA   
        Set the width rectangle

        ACCEPTS: float
        N(   R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   X
  s    	c         C` s   | |  _  t |  _ d S(   uA   
        Set the width rectangle

        ACCEPTS: float
        N(   R   R#   Ri   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  a
  s    	c         G` sn   t  |  d k r+ | d \ } } } } n | \ } } } } | |  _ | |  _ | |  _ | |  _ t |  _ d S(   uj   
        Set the bounds of the rectangle: l,b,w,h

        ACCEPTS: (left, bottom, width, height)
        i    N(   R5   R.  R/  R   R   R#   Ri   (   R   R  R  R   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  j
  s    				c         C` s%   t  j j |  j |  j |  j |  j  S(   N(   R   R   t   from_boundsR.  R/  R   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  z
  s    N(   R   R   R   R#   Rl   R   R	   R   R   R   R1  R9  R:  R<  R=  R>  RC   R   R   R   R   R   R   R   R  R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR-  	  s4   
	-																					t   ConnectionStylec           B` s   e  Z d  Z i  Z d e f d     YZ d e f d     YZ e e d <d e f d     YZ e e d <d	 e f d
     YZ e e d <d e f d     YZ	 e	 e d <d e f d     YZ
 e
 e d <e r e j e  i e e  d 6Z n  RS(   u0  
    :class:`ConnectionStyle` is a container class which defines
    several connectionstyle classes, which is used to create a path
    between two points. These are mainly used with
    :class:`FancyArrowPatch`.

    A connectionstyle object can be either created as::

           ConnectionStyle.Arc3(rad=0.2)

    or::

           ConnectionStyle("Arc3", rad=0.2)

    or::

           ConnectionStyle("Arc3, rad=0.2")

    The following classes are defined

    %(AvailableConnectorstyles)s


    An instance of any connection style class is an callable object,
    whose call signature is::

        __call__(self, posA, posB,
                 patchA=None, patchB=None,
                 shrinkA=2., shrinkB=2.)

    and it returns a :class:`Path` instance. *posA* and *posB* are
    tuples of x,y coordinates of the two points to be
    connected. *patchA* (or *patchB*) is given, the returned path is
    clipped so that it start (or end) from the boundary of the
    patch. The path is further shrunk by *shrinkA* (or *shrinkB*)
    which is given in points.

    R  c           B` sQ   e  Z d  Z d d d     YZ d   Z d   Z d d d	 d	 d  Z d   Z RS(
   u  
        A base class for connectionstyle classes. The subclass needs
        to implement a *connect* method whose call signature is::

          connect(posA, posB)

        where posA and posB are tuples of x, y coordinates to be
        connected.  The method needs to return a path connecting two
        points. This base class defines a __call__ method, and a few
        helper methods.
        t   SimpleEventc           B` s   e  Z d    Z RS(   c         C` s   | \ |  _  |  _ d  S(   N(   RS   RT   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   
  s    (   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRA  
  s   c         ` s     rQ   f d   } y t  | |  \ } } Wn t k
 rG | } n X| } n   r  f d   } y t  | |  \ } } Wn t k
 r | } n X| } n  | S(   uI  
            Clip the path to the boundary of the patchA and patchB.
            The starting point of the path needed to be inside of the
            patchA and the end point inside the patch B. The *contains*
            methods of each patch object is utilized to test if the point
            is inside the path.
            c         ` s#   t  j j |   }   j |  d S(   Ni    (   R@  R  RA  RW   (   t
   xy_displayt   xy_event(   t   patchA(    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   insideA
  s    c         ` s#   t  j j |   }   j |  d S(   Ni    (   R@  R  RA  RW   (   RB  RC  (   t   patchB(    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   insideB
  s    (   R   R   (   R   RF   RD  RF  RE  t   leftt   rightRG  (    (   RD  RF  s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _clip
  s    	
	
	c   
      C` s   | ra | j  d \ } } t | | |  } y t | |  \ } } | } Wqa t k
 r] qa Xn  | r | j  d \ } } t | | |  }	 y t | |	  \ } } | } Wq t k
 r q Xn  | S(   u\   
            Shrink the path by fixed size (in points) with shrinkA and shrinkB
            i    i(   R  R   R   R   (
   R   RF   t   shrinkAt   shrinkBRS   RT   RE  RH  RI  RG  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _shrink
  s"    

g       @c   
      C` s@   |  j  | |  } |  j | | |  } |  j | | |  }	 |	 S(   u   
            Calls the *connect* method to create a path between *posA*
             and *posB*. The path is clipped and shrunken.
            (   t   connectRJ  RM  (
   R   t   posAt   posBRK  RL  RD  RF  RF   t   clipped_patht   shrunk_path(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  
  s    c         C` s"   t  j   t |  j j f |  j f S(   N(   R   R   R@  R   R   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    	(    N(	   R   R   R   RA  RJ  RM  R   R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  
  s   	#	t   Arc3c           B` s#   e  Z d  Z d d  Z d   Z RS(   uM  
        Creates a simple quadratic bezier curve between two
        points. The curve is created so that the middle control point
        (C1) is located at the same distance from the start (C0) and
        end points(C2) and the distance of the C1 to the line
        connecting C0-C2 is *rad* times the distance of C0-C2.
        g        c         C` s   | |  _  d S(   uE   
            *rad*
              curvature of the curve.
            N(   t   rad(   R   RT  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         C` s   | \ } } | \ } } | | d | | d } } | | | | }	 }
 |  j  } | | |
 | | |	 } } | | f | | f | | f g } t j t j t j g } t | |  S(   Ng       @(   RT  R   R.  R  (   R   RO  RP  R   R   Rk  Rl  t   x12t   y12RA  RB  t   fRD  t   cyR  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRN    s    			(   R   R   R   R   RN  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRS    s   u   arc3t   Angle3c           B` s&   e  Z d  Z d d d  Z d   Z RS(   u   
        Creates a simple quadratic bezier curve between two
        points. The middle control points is placed at the
        intersecting point of two lines which crosses the start (or
        end) point and has a angle of angleA (or angleB).
        iZ   i    c         C` s   | |  _  | |  _ d S(   u   
            *angleA*
              starting angle of the path

            *angleB*
              ending angle of the path
            N(   t   angleAt   angleB(   R   RZ  R[  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   :  s    		c      	   C` s   | \ } } | \ } } t  j t  j |  j   } t  j t  j |  j   } t  j t  j |  j   }	 t  j t  j |  j   }
 t | | | | | | |	 |
  \ } } | | f | | f | | f g } t j t j	 t j	 g } t | |  S(   N(
   Re  Rh  t   radiansRZ  Ri  R[  R   R   R.  R  (   R   RO  RP  R   R   Rk  Rl  t   cosAt   sinAt   cosBt   sinBRD  RX  R  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRN  F  s    !(   R   R   R   R   RN  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRY  2  s   u   angle3t   Anglec           B` s)   e  Z d  Z d d d d  Z d   Z RS(   uL  
        Creates a picewise continuous quadratic bezier path between
        two points. The path has a one passing-through point placed at
        the intersecting point of two lines which crosses the start
        (or end) point and has a angle of angleA (or angleB).  The
        connecting edges are rounded with *rad*.
        iZ   i    g        c         C` s   | |  _  | |  _ | |  _ d S(   u   
            *angleA*
              starting angle of the path

            *angleB*
              ending angle of the path

            *rad*
              rounding radius of the edge
            N(   RZ  R[  RT  (   R   RZ  R[  RT  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   b  s    		c      	   C` s  | \ } } | \ } } t  j t  j |  j   } t  j t  j |  j   } t  j t  j |  j   }	 t  j t  j |  j   }
 t | | | | | | |	 |
  \ } } | | f g } t j g } |  j	 d k r | j
 | | f  | j
 t j  n | | | | } } | d | d d } |  j	 | } | | | | } } | d | d d } |  j	 | } | j | | | | | | f | | f | | | | | | f g  | j t j t j t j g  | j
 | | f  | j
 t j  t | |  S(   Ng        i   g      ?(   Re  Rh  R\  RZ  Ri  R[  R   R   R.  RT  R  R/  R  R  (   R   RO  RP  R   R   Rk  Rl  R]  R^  R_  R`  RD  RX  R  R3  t   dx1t   dy1t   d1t   f1t   dx2t   dy2t   d2t   f2(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRN  s  s4    	 (   R   R   R   R   RN  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRa  Y  s   u   angleR  c           B` s/   e  Z d  Z d d d d d d  Z d   Z RS(   u9  
        Creates a picewise continuous quadratic bezier path between
        two points. The path can have two passing-through points, a
        point placed at the distance of armA and angle of angleA from
        point A, another point with respect to point B. The edges are
        rounded with *rad*.
        i    g        c         C` s1   | |  _  | |  _ | |  _ | |  _ | |  _ d S(   uH  
            *angleA* :
              starting angle of the path

            *angleB* :
              ending angle of the path

            *armA* :
              length of the starting arm

            *armB* :
              length of the ending arm

            *rad* :
              rounding radius of the edges
            N(   RZ  R[  t   armAt   armBRT  (   R   RZ  R[  Rj  Rk  RT  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s
    				c         C` s)  | \ } } | \ } } | | f g } g  } t  j g }	 |  j r t j t j |  j   }
 t j t j |  j   } |  j |  j } | j	 | | |
 | | | f  |  j } | j	 | | |
 | | | f  n  |  j
 rXt j t j |  j   } t j t j |  j   } | |  j
 | | |  j
 | } } | r| d \ } } | | | | } } | | | | d } | j	 | |  j | | | |  j | | f  | j |  |	 j t  j t  j t  j g  n; | d \ } } | | | | } } | | | | d } | |  j } | | | | | | | | f | | f g } n  | r| d \ } } | | | | } } | | | | d } | j	 | |  j | | | |  j | | f  | j |  |	 j t  j t  j t  j g  n  | j	 | | f  |	 j	 t  j  t  | |	  S(   Nig      ?(   R   R.  Rj  Re  Rh  R\  RZ  Ri  RT  R  Rk  R[  R  R/  R  (   R   RO  RP  R   R   Rk  Rl  R  t   roundedR3  R]  R^  t   dR_  R`  t   x_armBt   y_armBt   xpt   ypRA  RB  t   dd(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRN    sZ    	#	&	#!N(   R   R   R   R   R   RN  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   arct   Barc           B` s,   e  Z d  Z d d d d d  Z d   Z RS(   u  
        A line with *angle* between A and B with *armA* and
        *armB*. One of the arms is extended so that they are connected in
        a right angle. The length of armA is determined by (*armA*
        + *fraction* x AB distance). Same for armB.
        g        g333333?c         C` s(   | |  _  | |  _ | |  _ | |  _ d S(   u  
            Parameters
            ----------
            armA : float
                minimum length of armA

            armB : float
                minimum length of armB

            fraction : float
                a fraction of the distance between two points that
                will be added to armA and armB.

            angle : float or None
                angle of the connecting line (if None, parallel
                to A and B)
            N(   Rj  Rk  t   fractionR   (   R   Rj  Rk  Rt  R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    			c         C` s  | \ } } | \ } } \ } } t  j | | | |  }	 | | | | }
 } |
 |
 | | d } |
 | | | } } |  j |  j } } |  j d  k	 r\t j |  j  } |	 | } | t  j |  } | t  j	 |  } | | t  j	 |  | | t  j |  } } | | } | | | | }
 } |
 |
 | | d } |
 | | | } } n d } t
 | |  } |  j | | } | | | | | | } } | | | | | | } } | | f | | f | | f | | f g } t j t j t j t j g } t | |  S(   Ng      ?g        (   Re  Rf  Rj  Rk  R   R   R   R  Ri  Rh  R  Rt  R   R.  R/  (   R   RO  RP  R   R   t   x20t   y20Rk  Rl  R)  RA  RB  Rr  t   ddxt   ddyRj  Rk  t   theta0t   dthetat   dlt   dLt   dd2t   armRW  t   cx1t   cy1t   cx2t   cy2R  R3  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRN    s>    
/
			N(   R   R   R   R   R   RN  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRs    s   u   baru   AvailableConnectorstyles(   R   R   R   R  R)  R  RS  RY  Ra  R  Rs  R   R*  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR@  
  s    &d#
%
=
]
K
c   
      C` sV   |  | | | } } | | | | | d } |  | | | | | } }	 | |	 f S(   uj   
    find a point along a line connecting (x0, y0) -- (x1, y1) whose
    distance from (x0, y0) is d.
    g      ?(    (
   R   R   R   R   Rm  RA  RB  t   ffRk  Rl  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _point_along_a_lineI  s    t
   ArrowStylec           B` s?  e  Z d  Z i  Z d e f d     YZ d e f d     YZ d e f d     YZ e e d <d e f d	     YZ e e d
 <d e f d     YZ	 e	 e d <d e f d     YZ
 e
 e d <d e f d     YZ e e d <d e f d     YZ e e d <d e f d     YZ e e d <d e f d     YZ d e f d     YZ e e d <d e f d      YZ e e d! <d" e f d#     YZ e e d$ <d% e f d&     YZ e e d' <d( e f d)     YZ e e d* <d+ e f d,     YZ e e d- <d. e f d/     YZ e e d0 <e r=e j e  i e e  d1 6Z n  RS(2   u  
    :class:`ArrowStyle` is a container class which defines several
    arrowstyle classes, which is used to create an arrow path along a
    given path. These are mainly used with :class:`FancyArrowPatch`.

    A arrowstyle object can be either created as::

           ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)

    or::

           ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)

    or::

           ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")

    The following classes are defined

    %(AvailableArrowstyles)s


    An instance of any arrow style class is a callable object,
    whose call signature is::

        __call__(self, path, mutation_size, linewidth, aspect_ratio=1.)

    and it returns a tuple of a :class:`Path` instance and a boolean
    value. *path* is a :class:`Path` instance along which the arrow
    will be drawn. *mutation_size* and *aspect_ratio* have the same
    meaning as in :class:`BoxStyle`. *linewidth* is a line width to be
    stroked. This is meant to be used to correct the location of the
    head so that it does not overshoot the destination point, but not all
    classes support it.
    R  c           B` s;   e  Z d  Z e d    Z d   Z d d  Z d   Z RS(   u  
        Arrow Transmuter Base class

        ArrowTransmuterBase and its derivatives are used to make a fancy
        arrow around a given path. The __call__ method returns a path
        (which will be used to create a PathPatch instance) and a boolean
        value indicating the path is open therefore is not fillable.  This
        class is not an artist and actual drawing of the fancy arrow is
        done by the FancyArrowPatch class.

        c         C` s   t  |  j    } t |  d k sR | d d t j k sR | d d t j k ra t d   n  t  | d d  t  | d d  S(   u2   Some ArrowStyle class only wokrs with a simple
            quaratic bezier curve (created with Arc3Connetion or
            Angle3Connector). This static method is to check if the
            provided path is a simple quadratic bezier curve and returns
            its control points if true.
            i   i    i   u.   'path' it's not a valid quadratic Bezier curve(   RL  t   iter_segmentsR5   R   R.  R  R   (   RF   t   segments(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   ensure_quadratic_bezier  s    )c         C` s   t  d   d S(   u  
            The transmute method is the very core of the ArrowStyle
            class and must be overridden in the subclasses. It receives
            the path object along which the arrow will be drawn, and
            the mutation_size, with which the arrow head etc.
            will be scaled. The linewidth may be used to adjust
            the path so that it does not pass beyond the given
            points. It returns a tuple of a Path instance and a
            boolean. The boolean value indicate whether the path can
            be filled or not. The return value can also be a list of paths
            and list of booleans of a same length.
            u   Derived must overrideN(   R   (   R   RF   R  R:   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    g      ?c         C` s.  t  |  } | d k	 r| j | j } } | d d  d f | | d d  d f <t | |  } |  j | | |  \ } }	 t j |	  r
g  }
 xg t |  D]Y } | j | j } } | d d  d f | | d d  d f <|
 j	 t | |   q W|
 |	 f S| |	 f Sn |  j | | |  Sd S(   u   
            The __call__ method is a thin wrapper around the transmute method
            and take care of the aspect ratio.
            Ni   (
   R   R   R  R3  R   R  R   t   iterableR   R  (   R   RF   R  R:   R  R  R3  t   path_shrunkt   path_mutatedt   fillablet	   path_listR
  R8  Rw   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s"    *	*
c         C` s"   t  j   t |  j j f |  j f S(   N(   R   R   R  R   R   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    	(   R   R   R   t   staticmethodR  R  R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  |  s
   	 t   _Curvec           B` s;   e  Z d  Z d d e e d d d  Z d   Z d   Z RS(   u*  
        A simple arrow which will work with any path instance. The
        returned path is simply concatenation of the original path + at
        most two paths representing the arrow head at the begin point and the
        at the end point. The arrow heads can be either open or closed.
        g?g?c         C` sS   | | |  _  |  _ | | |  _ |  _ | | |  _ |  _ t t j |   j	   d S(   u>  
            The arrows are drawn if *beginarrow* and/or *endarrow* are
            true. *head_length* and *head_width* determines the size
            of the arrow relative to the *mutation scale*.  The
            arrowhead at the begin (or end) is closed if fillbegin (or
            fillend) is True.
            N(
   t
   beginarrowt   endarrowRO  RN  t	   fillbegint   fillendR  R  R  R   (   R   R  R  R  R  RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    
c	         C` s>  | | | | }	 }
 t  j |	 |
  } d | | } | d k rJ d } n  | |	 | } | |
 | } |	 | | }	 |
 | | }
 | |	 | |
 | |	 | |
 } } | |	 | |
 | |	 | |
 } } | | | | | | f | | | | f | | | | | | f g } t j t j t j g } | | | | f S(   u  
            Return the paths for arrow heads. Since arrow lines are
            drawn with capstyle=projected, The arrow goes beyond the
            desired point. This method also returns the amount of the path
            to be shrunken so that it does not overshoot.
            g      ?i    i   (   R   R>  R   R.  R/  (   R   R   R   R   R   t	   head_distt   cos_tt   sin_tR:   RA  RB  t   cp_distancet   pad_projectedRw  Rx  Rb  Rc  Rf  Rg  t   vertices_arrowt   codes_arrow(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_arrow_wedge  s$    	&%c      	   C` s"  |  j  | } |  j | } t j | d | d  } | | | | } } | j d \ }	 }
 | j d \ } } |  j o |	 | k o |
 | k } | r |  j | | |	 |
 | | | |  \ } } } } n g  g  } } d \ } } | j d \ } } | j d \ } } |  j o)| | k o(| | k } | re|  j | | | | | | | |  \ } } } } n g  g  } } d \ } } t t	 j
 |	 | |
 | f g | j d d !| | | | f g g  | j  g } t g } | ry|  j rSt	 j
 | | d | d g g  } t	 j
 | t j t j g g  } | j t | |   | j t  qy| j t | |   | j t  n  | r|  j r| j t  t	 j
 | | d | d g g  } t	 j
 | t j t j g g  } | j t | |   q| j t  | j t | |   n  | | f S(	   Ni   i    i   g        ii(   g        g        (   g        g        (   RO  RN  Re  Rg  R  R  R  R  R   R   R%  R3  Rm   R  R/  R4  R  R#   R  (   R   RF   R  R:   RO  RN  R  R  R  R   R   R   R   t   has_begin_arrowt	   verticesAt   codesAt   ddxAt   ddyARk  Rl  t   x3t   y3t   has_end_arrowt	   verticesBt   codesBt   ddxBt   ddyBR  t	   _fillableR
  Rw   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s\    "	"			!	!N(   R   R   R   R   Rm   R   R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   	+t   Curvec           B` s   e  Z d  Z d   Z RS(   u8   
        A simple curve without any arrow head.
        c         C` s&   t  t j |   j d t d t  d  S(   NR  R  (   R  R  R  R   Rm   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   b  s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  ]  s   u   -t   CurveAc           B` s   e  Z d  Z d d d  Z RS(   u:   
        An arrow with a head at its begin point.
        g?g?c      	   C` s2   t  t j |   j d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  RO  RN  N(   R  R  R  R   R#   Rm   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   m  s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  h  s   u   <-t   CurveBc           B` s   e  Z d  Z d d d  Z RS(   u8   
        An arrow with a head at its end point.
        g?g?c      	   C` s2   t  t j |   j d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  RO  RN  N(   R  R  R  R   Rm   R#   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  ~  s   u   ->t   CurveABc           B` s   e  Z d  Z d d d  Z RS(   uJ   
        An arrow with heads both at the begin and the end point.
        g?g?c      	   C` s2   t  t j |   j d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  RO  RN  N(   R  R  R  R   R#   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   <->t   CurveFilledAc           B` s   e  Z d  Z d d d  Z RS(   uB   
        An arrow with filled triangle head at the begin.
        g?g?c         C` s>   t  t j |   j d t d t d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  R  R  RO  RN  N(   R  R  R  R   R#   Rm   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   <|-t   CurveFilledBc           B` s   e  Z d  Z d d d  Z RS(   u@   
        An arrow with filled triangle head at the end.
        g?g?c         C` s>   t  t j |   j d t d t d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  R  R  RO  RN  N(   R  R  R  R   Rm   R#   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   -|>t   CurveFilledABc           B` s   e  Z d  Z d d d  Z RS(   uC   
        An arrow with filled triangle heads at both ends.
        g?g?c         C` s>   t  t j |   j d t d t d t d t d | d |  d S(   u   
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.2
                Width of the arrow head
            R  R  R  R  RO  RN  N(   R  R  R  R   R#   (   R   RO  RN  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    (   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   <|-|>t   _Bracketc           B` sA   e  Z d d d  d  d d d d d d d 
 Z d   Z d   Z RS(   g      ?g?c         C` sc   | | |  _  |  _ | | |  _ |  _ | | |  _ |  _ | | |  _ |  _ |	 |
 |  _ |  _	 d  S(   N(
   t   bracketAt   bracketBt   widthAt   widthBt   lengthAt   lengthBRZ  R[  t   scaleAt   scaleB(   R   R  R  R  R  R  R  RZ  R[  R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s
    c         C` s   d d l  m } | | | | | |  \ } }	 }
 } | | | | } } | | |	 | f | |	 f |
 | f |
 | | | f g } t j t j t j t j g } | | f S(   Ni    (   t   get_normal_points(   t   matplotlib.bezierR  R   R.  R/  (   R   R   R   R  R  R   RT  R  R   R   Rk  Rl  RA  RB  R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   _get_bracket  s    $		c         C` s  |  j  d  k r | } n	 |  j  } |  j d  k r9 | } n	 |  j } g  g  } } |  j r | j d \ } }	 | j d \ }
 } t |
 | | |	  \ } } |  j | |	 | | |  j | |  j |  \ } } | j	 |  | j	 |  n  | j	 | j  | j	 | j
  |  j r| j d \ } }	 | j d \ }
 } t |
 | | |	  \ } } |  j | |	 | | |  j | |  j |  \ } } | j	 |  | j	 |  n  t j |  } t j |  } t | |  } | t f S(   Ni    i   ii(   R  R   R  R  R  R   R  R  R  R  R3  R  R  R  R   R%  R   Rm   (   R   RF   R  R:   R  R  t   vertices_listt
   codes_listR   R   R   R   R  R  R  R  R  R  R  R3  R
  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s>    					
	
N(   R   R   R   R   R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   	t	   BracketABc           B` s)   e  Z d  Z d d d d d d d  Z RS(   u:   
        An arrow with a bracket(]) at both ends.
        g      ?g?c         C` sD   t  t j |   j t t d | d | d | d | d | d | d S(   u  
            Parameters
            ----------
            widthA : float, optional, default : 1.0
                Width of the bracket

            lengthA : float, optional, default : 0.2
                Length of the bracket

            angleA : float, optional, default : None
                Angle between the bracket and the line

            widthB : float, optional, default : 1.0
                Width of the bracket

            lengthB : float, optional, default : 0.2
                Length of the bracket

            angleB : float, optional, default : None
                Angle between the bracket and the line
            R  R  RZ  R  R  R[  N(   R  R  R  R   R#   (   R   R  R  RZ  R  R  R[  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   A  s    N(   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  <  s   	u   ]-[t   BracketAc           B` s    e  Z d  Z d d d d  Z RS(   u9   
        An arrow with a bracket(])  at its end.
        g      ?g?c      	   C` s2   t  t j |   j t d d | d | d | d S(   u]  
            Parameters
            ----------
            widthA : float, optional, default : 1.0
                Width of the bracket

            lengthA : float, optional, default : 0.2
                Length of the bracket

            angleA : float, optional, default : None
                Angle between the bracket and the line
            R  R  RZ  N(   R  R  R  R   R#   R   (   R   R  R  RZ  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   f  s    N(   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  a  s   u   ]-t   BracketBc           B` s    e  Z d  Z d d d d  Z RS(   u9   
        An arrow with a bracket([)  at its end.
        g      ?g?c      	   C` s2   t  t j |   j d t d | d | d | d S(   u]  
            Parameters
            ----------
            widthB : float, optional, default : 1.0
                Width of the bracket

            lengthB : float, optional, default : 0.2
                Length of the bracket

            angleB : float, optional, default : None
                Angle between the bracket and the line
            R  R  R[  N(   R  R  R  R   R   R#   (   R   R  R  R[  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    N(   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  {  s   u   -[t   BarABc           B` s#   e  Z d  Z d d d d d  Z RS(   u6   
        An arrow with a bar(|) at both ends.
        g      ?c         C` sD   t  t j |   j t t d | d d d | d | d d d | d S(	   u  
            Parameters
            ----------
            widthA : float, optional, default : 1.0
                Width of the bracket

            angleA : float, optional, default : None
                Angle between the bracket and the line

            widthB : float, optional, default : 1.0
                Width of the bracket

            angleB : float, optional, default : None
                Angle between the bracket and the line
            R  R  i    RZ  R  R  R[  N(   R  R  R  R   R#   (   R   R  RZ  R  R[  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    N(   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   |-|t   Simplec           B` s)   e  Z d  Z d d d d  Z d   Z RS(   uK   
        A simple arrow. Only works with a quadratic bezier curve.
        g      ?g?c         C` s7   | | | |  _  |  _ |  _ t t j |   j   d S(   u_  
            Parameters
            ----------
            head_length : float, optional, default : 0.5
                Length of the arrow head

            head_width : float, optional, default : 0.5
                Width of the arrow head

            tail_width : float, optional, default : 0.2
                Width of the arrow tail
            N(   RO  RN  t
   tail_widthR  R  R  R   (   R   RO  RN  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c         C` s  |  j  |  \ } } } } } }	 |  j | }
 t | |	 |
  } | | f | | f | |	 f g } d d l m } y t | | d d \ } } Wns | k
 rt | |	 | | |
  \ } } d | | d | |	 } } | | f | | f | |	 f g } d  } n X|  j | } t	 | | d d d \ } } | d  k	 r=|  j
 | } t | | d  \ } } t j | d f t j | d f t j | d	 f t j | d f t j | d f t j | d	 f t j | d f t j | d f t j | d	 f t j | d f t j | d f t j | d f t j | d f g } nf t j | d f t j | d f t j | d	 f t j | d f t j | d f t j | d f g } t g  | D] \ } } | ^ qg  | D] \ } } | ^ q } | t f S(
   Ni   (   t   NonIntersectingPathExceptiont	   tolerenceg{Gz?g      ?g       @t   wmi    i   (   R  RO  R   t   bezierR  R   R  R   RN  R   R  R   R   R.  R  R/  R4  R#   (   R   RF   R  R:   R   R   R   R   Rk  Rl  RO  t   in_ft
   arrow_pathR  t	   arrow_outt   arrow_int   x1nt   y1nRN  t	   head_leftt
   head_rightR  t	   tail_leftt
   tail_rightt
   patch_pathRw   R
  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    sT    !!!
A(   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s   u   simplet   Fancyc           B` s)   e  Z d  Z d d d d  Z d   Z RS(   uJ   
        A fancy arrow. Only works with a quadratic bezier curve.
        g?c         C` s7   | | | |  _  |  _ |  _ t t j |   j   d S(   u_  
            Parameters
            ----------
            head_length : float, optional, default : 0.4
                Length of the arrow head

            head_width : float, optional, default : 0.4
                Width of the arrow head

            tail_width : float, optional, default : 0.4
                Width of the arrow tail
            N(   RO  RN  R  R  R  R  R   (   R   RO  RN  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    c          C` s  |  j  |  \ } } } } } }	 |  j | }
 | | f | | f | |	 f g } d d l m } t | |	 |
  } y t | | d d \ } } Wns | k
 rt | |	 | | |
  \ } } d | | d | |	 } } | | f | | f | |	 f g } | } n X| } t | |	 |
 d  } t | | d d \ } } | } |  j | } t | | d d d	 \ } } |  j	 | } t | | d d
 d d d	 d d \ } } t | | | d  } t | | d d \ } } | d } | | } } t
 j | f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | d f t
 j | f t
 j | f g } t
 g  | D] \ } } | ^ qg  | D] \ } } | ^ q } | t f S(   Ni   (   R  R  g{Gz?g      ?g?g       @R  g333333?t   w1g      ?t   w2g333333?ii    i   (   R  RO  R  R  R   R   R  RN  R   R  R   R.  R/  R  R4  R#   (    R   RF   R  R:   R   R   R   R   Rk  Rl  RO  R  R  R  t   path_outt   path_inR  R  t	   path_headt	   path_tailRN  t   head_lt   head_rR  R  R  t
   tail_startR  R  R  Rw   R
  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  !  sj    !!!



A(   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  
  s   u   fancyR'  c           B` s&   e  Z d  Z d d d  Z d   Z RS(   u   
        Wedge(?) shape. Only works with a quadratic bezier curve.  The
        begin point has a width of the tail_width and the end point has a
        width of 0. At the middle, the width is shrink_factor*tail_width.
        g333333?g      ?c         C` s,   | |  _  | |  _ t t j |   j   d S(   u  
            Parameters
            ----------
            tail_width : float, optional, default : 0.3
                Width of the tail

            shrink_factor : float, optional, default : 0.5
                Fraction of the arrow width at the middle point
            N(   R  t   shrink_factorR  R  R'  R   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   x  s    		c      	   C` s,  |  j  |  \ } } } } } }	 | | f | | f | |	 f g }
 t |
 |  j | d d |  j \ } } t j | d f t j | d f t j | d f t j | d f t j | d f t j | d f t j | d f g } t g  | D] \ } } | ^ q g  | D] \ } } | ^ q } | t	 f S(   Ng       @R  i    i   i   (
   R  R   R  R  R   R.  R  R/  R4  R#   (   R   RF   R  R:   R   R   R   R   Rk  Rl  R  t   b_plust   b_minusR  Rw   R
  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    !!A(   R   R   R   R   R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR'  q  s   u   wedgeu   AvailableArrowstyles(   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  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  U  sH   #Z	






M#



U
e
,
t   AvailableArrowstylest   AvailableConnectorstylest   FancyArrowPatchc           B` s   e  Z d  Z e Z d   Z e j d d d d d d d d d d d d d d d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   u%  
    A fancy arrow patch. It draws an arrow using the :class:`ArrowStyle`.

    The head and tail positions are fixed at the specified start and end points
    of the arrow, but the size and shape (in display coordinates) of the arrow
    does not change when the axis is moved or zoomed.
    c         C` sj   |  j  d  k	 rH |  j  \ \ } } \ } } |  j j d | | | | f S|  j j d t |  j  f Sd  S(   Nu   (%g,%g->%g,%g)u   (%s)(   t
   _posA_posBR   R   R   R   t   _path_original(   R   R   R   Rk  Rl  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s    		u   simpleu   arc3i   i   c         K` s
  t  j |  |  | d k	 rh | d k	 rh | d k rh | | g |  _ | d k rX d } n  |  j |  nE | d k r | d k r | d k	 r d |  _ d |  _ n t d   | |  _ |	 |  _ |
 |  _	 | |  _
 | |  _ |  j |  | |  _ | |  _ |  j |  d S(   u  
        If *posA* and *posB* are given, a path connecting two points is
        created according to *connectionstyle*. The path will be
        clipped with *patchA* and *patchB* and further shrunken by
        *shrinkA* and *shrinkB*. An arrow is drawn along this
        resulting path using the *arrowstyle* parameter.

        Alternatively if *path* is provided, an arrow is drawn along this path
        and *patchA*, *patchB*, *shrinkA*, and *shrinkB* are ignored.

        Parameters
        ----------

        posA, posB : None, tuple, optional (default: None)
            (x,y) coordinates of arrow tail and arrow head respectively.

        path : None, Path (default: None)
            :class:`matplotlib.path.Path` instance. If provided, an arrow is
            drawn along this path and *patchA*, *patchB*, *shrinkA*, and
            *shrinkB* are ignored.

        arrowstyle : str or ArrowStyle, optional (default: 'simple')
            Describes how the fancy arrow will be
            drawn. It can be string of the available arrowstyle names,
            with optional comma-separated attributes, or an
            :class:`ArrowStyle` instance. The optional attributes are meant to
            be scaled with the *mutation_scale*. The following arrow styles are
            available:

            %(AvailableArrowstyles)s

        arrow_transmuter :
            Ignored

        connectionstyle : str, ConnectionStyle, or None, optional
        (default: 'arc3')
            Describes how *posA* and *posB* are connected. It can be an
            instance of the :class:`ConnectionStyle` class or a string of the
            connectionstyle name, with optional comma-separated attributes. The
            following connection styles are available:

            %(AvailableConnectorstyles)s

        connector :
            Ignored

        patchA, patchB : None, Patch, optional (default: None)
            Head and tail patch respectively. :class:`matplotlib.patch.Patch`
            instance.

        shrinkA, shrinkB : scalar, optional (default: 2)
            Shrinking factor of the tail and head of the arrow respectively

        mutation_scale : scalar, optional (default: 1)
            Value with which attributes of *arrowstyle* (e.g., *head_length*)
            will be scaled.

        mutation_aspect : None, scalar, optional (default: None)
            The height of the rectangle will be squeezed by this value before
            the mutation and the mutated box will be stretched by the inverse
            of it.

        dpi_cor : scalar, optional (default: 1)
            dpi_cor is currently used for linewidth-related things and shrink
            factor. Mutation scale is affected by this.

        Notes
        -----
        Valid kwargs are:
        %(Patch)s
        u   arc3u.   either posA and posB, or path need to providedN(   R   R   R   R  t   set_connectionstylet
   _connetorsR   RD  RF  RK  RL  R  t   set_arrowstyleR2  R3  t   set_dpi_cor(   R   RO  RP  RF   t
   arrowstylet   arrow_transmutert   connectionstyleR5  RD  RF  RK  RL  R6  R7  t   dpi_corRA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     s&    V$	$								c         C` s   | |  _  t |  _ d S(   u   
        dpi_cor is currently used for linewidth-related things and
        shrink factor. Mutation scale is affected by this.

        Parameters
        ----------
        dpi_cor : scalar
        N(   t   _dpi_corR#   Ri   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  1  s    		c         C` s   |  j  S(   u   
        dpi_cor is currently used for linewidth-related things and
        shrink factor. Mutation scale is affected by this.

        Returns
        -------
        dpi_cor : scalar
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_dpi_cor=  s    	c         C` sE   | d k	 r | |  j d <n  | d k	 r8 | |  j d <n  t |  _ d S(   u  
        Set the begin and end positions of the connecting path.

        Parameters
        ----------
        posA, posB : None, tuple
            (x,y) coordinates of arrow tail and arrow head respectively. If
            `None` use current value.
        i    i   N(   R   R  R#   Ri   (   R   RO  RP  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_positionsH  s
    
c         C` s   | |  _  t |  _ d S(   u   
        Set the tail patch.

        Parameters
        ----------
        patchA : Patch
            :class:`matplotlib.patch.Patch` instance.
        N(   RD  R#   Ri   (   R   RD  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_patchAX  s    		c         C` s   | |  _  t |  _ d S(   u   
        Set the head patch.

        Parameters
        ----------
        patchB : Patch
            :class:`matplotlib.patch.Patch` instance.
        N(   RF  R#   Ri   (   R   RF  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt
   set_patchBd  s    		c         K` s_   | d k r t j   St | t j  s4 t |  r@ | |  _ n t | |  |  _ t |  _ d S(   u  
        Set the connection style. Old attributes are forgotten.

        Parameters
        ----------
        connectionstyle : None, ConnectionStyle instance, or string
            Can be a string with connectionstyle name with
            optional comma-separated attributes, e.g.::

                set_connectionstyle("arc,angleA=0,armA=30,rad=10")

            Alternatively, the attributes can be provided as keywords, e.g.::

                set_connectionstyle("arc", angleA=0,armA=30,rad=10)

            Without any arguments (or with ``connectionstyle=None``), return
            available styles as a list of strings.
        N(	   R   R@  R  R8  R  RP   t
   _connectorR#   Ri   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  p  s    
c         C` s   |  j  S(   u?   
        Return the :class:`ConnectionStyle` instance.
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_connectionstyle  s    c         K` sS   | d k r t j   St | t j  r4 | |  _ n t | |  |  _ t |  _ d S(   uO  
        Set the arrow style. Old attributes are forgotten. Without arguments
        (or with ``arrowstyle=None``) returns available box styles as a list of
        strings.

        Parameters
        ----------
        arrowstyle : None, ArrowStyle, str, optional (default: None)
            Can be a string with arrowstyle name with optional comma-separated
            attributes, e.g.::

                set_arrowstyle("Fancy,head_length=0.2")

            Alternatively attributes can be provided as keywords, e.g.::

                set_arrowstyle("fancy", head_length=0.2)

        N(   R   R  R  R8  R  t   _arrow_transmuterR#   Ri   (   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    
c         C` s   |  j  S(   u/   
        Return the arrowstyle object.
        (   R  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_arrowstyle  s    c         C` s   | |  _  t |  _ d S(   ug   
        Set the mutation scale.

        Parameters
        ----------
        scale : scalar
        N(   R2  R#   Ri   (   R   R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR9    s    	c         C` s   |  j  S(   ud   
        Return the mutation scale.

        Returns
        -------
        scale : scalar
        (   R2  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR:    s    c         C` s   | |  _  t |  _ d S(   u{   
        Set the aspect ratio of the bbox mutation.

        Parameters
        ----------
        aspect : scalar
        N(   R3  R#   Ri   (   R   R;  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR<    s    	c         C` s   |  j  S(   u?   
        Return the aspect ratio of the bbox mutation.
        (   R3  (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR=    s    c         C` sI   |  j    \ } } t j |  r0 t |  } n  |  j   j   j |  S(   u   
        Return the path of the arrow in the data coordinates. Use
        get_path_in_displaycoord() method to retrieve the arrow path
        in display coordinates.
        (   t   get_path_in_displaycoordR   R  R   RB   R  t   transform_path(   R   R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyRC     s    c         C` s   |  j    } |  j d k	 r |  j   j |  j d  } |  j   j |  j d  } |  j   | | d |  j d |  j d |  j | d |  j	 | } n |  j   j
 |  j  } |  j   | |  j   | |  j   | |  j    \ } } | | f S(   uN   
        Return the mutated path of the arrow in display coordinates.
        i    i   RD  RF  RK  RL  N(   R  R  R   RB   R  R  RD  RF  RK  RL  R  R  R  R:  RL   R=  (   R   R  RO  RP  R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s     			c         C` s  |  j    s d  S| j d |  j    | j   } | j |  j d t |  j } |  j d d k rm d } n  | j |  | j	 |  j
 |  j  | j |  j  |  j |  | j d  | j |  j    |  j } | d d k r d  } n  | j |  j  |  j rb| j |  j  |  j d  k	 rby | j |  j  Wq_t k
 r[t j d  q_Xqbn  |  j   d  k	 r| j |  j     n  |  j | j  d   |  j!   \ } } t" j# |  s| g } | g } n  t$ j%   } |  j&   rd d l' m( } | |  j&   |  } n  xR t) | |  D]A \ }	 }
 |
 rQ| j* | |	 | |  q&| j* | |	 | d   q&W| j+   | j, d  t- |  _. d  S(	   Nu   patchR   i   i    u   roundu6   Your backend does not support setting the hatch color.g      ?(   R   (/   R   R   R   R   R   R\   R#   R+   R.   R   R}   R~   R/   Rd   R   R1   R   R   R]   R   Rz   Rn   R^   R0   R"   Ro   R   R%   R&   R   R   R  R   R  R   R  R   R3   R   R   R   R   R   R   R   Rm   Ri   (   R   R   R   R   R   RF   R  R   R   R
  RW  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR     sV    						
N(   R   R   R   R#   Rl   R   R	   R   R   R   R  R  R  R  R  R  R  R  R  R9  R:  R<  R=  RC   R  R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    sB   	
f										
				t   ConnectionPatchc           B` s   e  Z d  Z d   Z e j d d d d d d d d d d d d d e d d   Z d d  Z	 d	   Z
 d
   Z d   Z d   Z d   Z RS(   u   
    A :class:`~matplotlib.patches.ConnectionPatch` class is to make
    connecting lines between two points (possibly in different axes).
    c         C` s0   d |  j  d |  j  d |  j d |  j d f S(   Nu    ConnectionPatch((%g,%g),(%g,%g))i    i   (   t   xy1t   xy2(   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   P  s    u   -u   arc3g        g      $@g      ?c         K` s   | d k r | } n  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ t j |  d d d d d | d | d |	 d |
 d	 | d
 | d | d | d | d | d | d | | d |  _	 d S(   u 	  
        Connect point *xyA* in *coordsA* with point *xyB* in *coordsB*


        Valid keys are


        ===============  ======================================================
        Key              Description
        ===============  ======================================================
        arrowstyle       the arrow style
        connectionstyle  the connection style
        relpos           default is (0.5, 0.5)
        patchA           default is bounding box of the text
        patchB           default is None
        shrinkA          default is 2 points
        shrinkB          default is 2 points
        mutation_scale   default is text size (in points)
        mutation_aspect  default is 1.
        ?                any key for :class:`matplotlib.patches.PathPatch`
        ===============  ======================================================


        *coordsA* and *coordsB* are strings that indicate the
        coordinates of *xyA* and *xyB*.

        =================   ===================================================
        Property            Description
        =================   ===================================================
        'figure points'     points from the lower left corner of the figure
        'figure pixels'     pixels from the lower left corner of the figure
        'figure fraction'   0,0 is lower left of figure and 1,1 is upper, right
        'axes points'       points from lower left corner of axes
        'axes pixels'       pixels from lower left corner of axes
        'axes fraction'     0,1 is lower left of axes and 1,1 is upper right
        'data'              use the coordinate system of the object being
                            annotated (default)
        'offset points'     Specify an offset (in points) from the *xy* value

        'polar'             you can specify *theta*, *r* for the annotation,
                            even in cartesian plots.  Note that if you
                            are using a polar axes, you do not need
                            to specify polar for the coordinate
                            system since that is the native "data" coordinate
                            system.
        =================   ===================================================

        RO  i    RP  i   R  R  R  R5  RD  RF  RK  RL  R6  R7  t   clip_onR  N(   i    i    (   i   i   (
   R   R  R  t   coords1t   coords2t   axesAt   axesBR  R   t   _annotation_clip(   R   t   xyAt   xyBt   coordsAt   coordsBR  R  R  R  R  R5  RD  RF  RK  RL  R6  R7  R  R  RA   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   T  s0    @							c         C` s  | d k r |  j } n  | d k rj | j } t |  j |   } t |  j |   } | j | | f  S| d k r|  j \ } } |  j d k r |  j	 | | d  S|  j	 | | |  j  \ } } |  j
 j   } | | d 9} | | d 9} | | 7} | | 7} | | f S| d k ri| | }	 }
 |
 t j |	  } |
 t j |	  } | j } | j | | f  S| d k r|  j
 j } |  j
 j j \ } } } } | | }
 | | } | | d 9} | | d 9} | d k  r|
 | } n  | d k  r| | } n  | | f S| d k r|  j
 j j \ } } } } | | }
 | | } | d k  r\|
 | } n  | d k  ru| | } n  | | f S| d k r|  j
 j } | j | | f  S| d	 k r^|  j
 j } | j j \ } } } } | | }
 | | } | d k  r|
 | | d } n | | | d } | d k  rB| | | d } n | | | d } | | f S| d
 k r| j j \ } } } } | | }
 | | } | d k  r|
 | } n
 | | } | d k  r| | } n
 | | } | | f S| d k r| j } | j | | f  Sd S(   u=   
        calculate the pixel position of given point
        u   datau   offset pointsg      R@u   polaru   figure pointsi    u   figure pixelsu   figure fractionu   axes pointsu   axes pixelsu   axes fractionN(   R   R  t	   transDataRx   R   R   R  R   t   xycoordsR  Rb  t   get_dpiR   Rh  Ri  Rc  R   R  t   transFiguret	   transAxes(   R   RS   RT   R   R  RE   RA  RB  Rc  Rs  R   R  R   R   R  t   t(    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR    s    	


	













	c         C` s   | |  _  t |  _ d S(   uM  
        set *annotation_clip* attribute.

          * True: the annotation will only be drawn when self.xy is inside the
                   axes.
          * False: the annotation will always be drawn regardless of its
                    position.
          * None: the self.xy will be checked only if *xycoords* is "data"
        N(   R   R#   Ri   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   set_annotation_clip  s    
	c         C` s   |  j  S(   u   
        Return *annotation_clip* attribute.
        See :meth:`set_annotation_clip` for the meaning of return values.
        (   R   (   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   get_annotation_clip%  s    c         C` s   |  j    } |  j \ } } |  j | | |  j |  j  } |  j \ } } |  j | | |  j |  j  } |  j   | | d |  j	 d |  j
 d |  j | d |  j | } |  j   | |  j   | |  j   | |  j    \ } } | | f S(   uK   
        Return the mutated path of the arrow in the display coord
        RD  RF  RK  RL  (   R  R  R  R  R  R  R  R  R  RD  RF  RK  RL  R  R:  RL   R=  (   R   R  RS   RT   RO  RP  R  R  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  ,  s     			c         C` s   |  j    } | s- | d k rs |  j d k rs |  j \ } } |  j | | |  j |  j  } |  j j |  ss t Sn  | s | d k r |  j	 d k r |  j
 \ } } |  j | | |  j	 |  j  } |  j d k r |  j } n	 |  j } | j |  s t Sn  t S(   uC   
        check if the annotation need to
        be drawn.
        u   dataN(   R  R   R  R  R  R  R  RR   Rm   R  R  R  R#   (   R   R   R   RS   RT   t   xy_pixelR  (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt	   _check_xyI  s    !!	c         C` sO   | d k	 r | |  _ n  |  j   s( d S|  j |  s; d St j |  |  d S(   u   
        Draw.
        N(   R   t	   _rendererR   R  R  R   (   R   R   (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR   c  s    N(   R   R   R   R   R	   R   R   Rm   R   R  R  R  R  R  R   (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyR  K  s.   	Pf				(L   t
   __future__R    R   R   R   R  t	   six.movesR   R   Re  R%   t   numpyR   t
   matplotlibR   t    R   R   R   R	   R
   R{   R   R  R   R   R   R   R   R   R   R   R   RF   R   t   _patch_alias_mapR   R   t   kwdoct   patchdocR  t   interpdR6   R   R   R   R   R  R  R  R'  R=  RI  R   R]  R  R  R  R  R   R#   R  R  R  R  R  R)  R  R  R  R-  R@  R  R  R  R  (    (    (    s1   lib/python2.7/site-packages/matplotlib/patches.pyt   <module>   s   ".@



  !ETm[Cch?( %	#		8   	   R 