
t,2Jc           @   s9  d  Z  d d k Z d d k Z d d k Z d d k Z d d k l Z d d k Z d d k	 i
 Z
 d d k i Z d d k i Z d d k i Z d d k i Z d d k i Z d d k i Z d d k i Z d e i e i f d     YZ d e i d <d e f d     YZ d	 e f d
     YZ  d e  f d     YZ! d e f d     YZ" d e" f d     YZ# d e" f d     YZ$ d e f d     YZ% d e f d     YZ& d e f d     YZ' d e f d     YZ( e i) e  e i d <Z* x0 d d	 d d d d d f D] Z+ e* e i e+ <qWe i) e%  e i d <d S(   sq  
Classes for the efficient drawing of large collections of objects that
share most properties, e.g. a large number of line segments or
polygons.

The classes are not meant to be as flexible as their single element
counterparts (e.g. you may not be able to select all line styles) but
they are meant to be fast for common use cases (e.g. a bunch of solid
line segemnts)
iN(   t   mat
   Collectionc           B   s  e  Z d  Z e i g  e i  Z e i   Z	 g  Z
 d Z 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   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' d   Z( e( Z) d    Z* e* Z+ d!   Z, d"   Z- d#   Z. d$   Z/ e/ Z0 d%   Z1 e1 Z2 Z3 d&   Z4 d'   Z5 RS()   s  
    Base class for Collections.  Must be subclassed to be usable.

    All properties in a collection must be sequences or scalars;
    if scalars, they will be converted to sequences.  The
    property of the ith element of the collection is::

      prop[i % len(props)]

    Keyword arguments and default values:

        * *edgecolors*: None
        * *facecolors*: None
        * *linewidths*: None
        * *antialiaseds*: None
        * *offsets*: None
        * *transOffset*: transforms.IdentityTransform()
        * *norm*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)
        * *cmap*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)

    *offsets* and *transOffset* are used to translate the patch after
    rendering (default no offsets).

    If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds*
    are None, they default to their :data:`matplotlib.rcParams` patch
    setting, in sequence form.

    The use of :class:`~matplotlib.cm.ScalarMappable` is optional.  If
    the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not None
    (ie a call to set_array has been made), at draw time a call to
    scalar mappable will be made to set the face colors.
    i   t   solidg      @c         K   s.  t  i i |   t i i |  | |	  |  i |  |  i |  |  i |  |  i |  |  i	 |  |  i
 |  d |  _ t i g  t i  |  _ | d j	 or t i |  } t | i  d j o | t i d d  f } n | d j	 o | |  _ | |  _ q| |  _ n |
 |  _ |  i |  d S(   s=   
        Create a Collection

        %(Collection)s
        i   N(   t   artistt   Artistt   __init__t   cmt   ScalarMappablet   set_edgecolort   set_facecolort   set_linewidtht   set_linestylet   set_antialiasedt   set_urlst   Nonet   _uniform_offsetst   npt   arrayt   float_t   _offsetst   asarrayt   lent   shapet   newaxist   _transOffsett   _pickradiust   update(   t   selft
   edgecolorst
   facecolorst
   linewidthst
   linestylest   antialiasedst   offsetst   transOffsett   normt   cmapt
   pickradiust   urlst   kwargs(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   @   s(    			c         C   s   y t  |  f SWn` t j
 oT t i |  o= t |  o0 y t  | d  Wn t j
 o qo X| Sqt n Xt d   d  S(   Ni    s1   val must be a float or nonzero sequence of floats(   t   floatt	   TypeErrort   cbookt   iterableR   (   R   t   val(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt
   _get_valuel   s       c         C   s   y t  |  f SWn` t j
 oT t i |  o= t |  o0 y t  | d  Wn t j
 o qo X| Sqt n Xt d   d  S(   Ni    s.   val must be a bool or nonzero sequence of them(   t   boolR)   R*   R+   R   (   R   R,   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt	   _get_boolv   s       c         C   s
   t   d  S(   N(   t   NotImplementedError(   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt	   get_paths   s    c         C   s   |  i  S(   N(   t   _transforms(   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_transforms   s    c   	      C   s   |  i    } |  i } |  i } |  i   } | i p: g  } | D] } | | i |  q? ~ } | i   } n | i p | i |  } | i   } n t i	 | t i
  } t i | i   | |  i   | | i    } | i |  } | S(   N(   t   get_transformR   R   R1   t	   is_affinet   transform_path_non_affinet
   get_affinet   transform_non_affineR   R   R   t   mpatht   get_path_collection_extentst   frozenR3   t   inverse_transformed(	   R   t	   transDatat	   transformR"   R!   t   pathst   _[1]t   pt   result(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_datalim   s     		
*
c         C   s   |  i  t i    } | S(   N(   RC   t
   transformst   IdentityTransform(   R   t   renderert   bbox(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_window_extent   s    c   
      C   s  |  i    } |  i } |  i } |  i   } |  i   og  } x |  i   D] } | i } | d d  d f | d d  d f } } |  i |  } |  i |  } | i t	 i
 t | |  | i   qJ Wt |  i  oW |  i |  i d d  d f  } |  i |  i d d  d f  } t | |  } q8n t i | t i  } | i p: g  }	 | D] } |	 | i |  qb~	 } | i   } n | i p | i |  } | i   } n | | | | f S(   s&   Point prep for drawing and hit testingNi    i   (   R4   R   R   R1   t
   have_unitst   verticest   convert_xunitst   convert_yunitst   appendR9   t   Patht   zipt   codesR   R   R   R   R5   R6   R7   R8   (
   R   R>   R"   R!   R?   t   pathRJ   t   xst   ysR@   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   _prepare_points   s2    		 	-)""
*
c         C   s   |  i    p d  S| i |  i i  |  i   |  i   \ } } | d  j	 o | i   } n |  i   \ } } } } | i	 | i   |  i
 | | | |  i   | | |  i   |  i   |  i |  i |  i |  i  | i |  i i  d  S(   N(   t   get_visiblet
   open_groupt	   __class__t   __name__t   update_scalarmappablet$   get_transformed_clip_path_and_affineR   R;   RT   t   draw_path_collectiont   clipboxR3   t   get_facecolort   get_edgecolort   _linewidthst   _linestylest   _antialiasedst   _urlst   close_group(   R   RF   t   clippatht   clippath_transR>   R"   R!   R?   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   draw   s     
c         C   s   t  |  i  o |  i |  |  S|  i   p t h  f S|  i   \ } } } } t i | i | i |  i	 | i
   | |  i   | | t |  i  d j 	 } t |  d j t d |  f S(   s   
        Test whether the mouse event occurred in the collection.

        Returns True | False, ``dict(ind=itemlist)``, where every
        item in itemlist contains the event.
        i    t   ind(   t   callablet	   _containsRU   t   FalseRT   R9   t   point_in_path_collectiont   xt   yR   R;   R3   R   t   _facecolorst   dict(   R   t
   mouseeventR>   R"   R!   R?   Rg   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   contains   s      c         C   s   d |  _  d  S(   Ni   (   R%   (   R   R%   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_pickradius   s    c         C   s   |  i  S(   N(   R%   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_pickradius   s    c         C   s*   | d  j o d  g |  _ n
 | |  _ d  S(   N(   R   Rb   (   R   R&   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR      s    c         C   s   |  i  S(   N(   Rb   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_urls   s    c         C   sr   t  i | t  i  } t | i  d j o | t  i d d  f } n |  i d j o | |  _ n
 | |  _ d S(   s   
        Set the offsets for the collection.  *offsets* can be a scalar
        or a sequence.

        ACCEPTS: float or sequence of floats
        i   N(	   R   R   R   R   R   R   R   R   R   (   R   R!   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_offsets   s    c         C   s#   |  i  d j o |  i S|  i  Sd S(   s8   
        Return the offsets for the collection.
        N(   R   R   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_offsets  s    c         C   s4   | d j o t i d } n |  i |  |  _ d S(   s   
        Set the linewidth(s) for the collection.  *lw* can be a scalar
        or a sequence; if it is a sequence the patches will cycle
        through the sequence

        ACCEPTS: float or sequence of floats
        s   patch.linewidthN(   R   t   mplt   rcParamsR-   R_   (   R   t   lw(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR
     s     c         C   s   |  i  |  S(   s   alias for set_linewidth(   R
   (   R   Ry   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_linewidths  s    c         C   s   |  i  |  S(   s   alias for set_linewidth(   R
   (   R   Ry   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_lw  s    c         C   s  yt  i i } t i |  oS | | j o | | g } q| t i j o | t i | g } qt    nt i |  oy g  } x | D] } t i |  o[ | | j o | i | |  q@| t i j o | i | t i |  q@t    q t i |  o$ t	 |  d j o | i |  q t    q WWqt j
 o- t	 |  d j o
 | } qt    qXn
 t    Wn# t j
 o t d |   n X| |  _
 d S(   s   
        Set the linestyle(s) for the collection.

        ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' |
        (offset, on-off-dash-seq) ]
        i   s'   Do not know how to convert %s to dashesN(   t   backend_basest   GraphicsContextBaset   dashdR*   t   is_string_liket	   ls_mappert
   ValueErrorR+   RM   R   R`   (   R   t   lsR~   t   dashesRl   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s<     #
c         C   s   |  i  |  S(   s   alias for set_linestyle(   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_linestylesH  s    c         C   s   |  i  |  S(   s   alias for set_linestyle(   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt
   set_dashesL  s    c         C   s4   | d j o t i d } n |  i |  |  _ d S(   sm   
        Set the antialiasing state for rendering.

        ACCEPTS: Boolean or sequence of booleans
        s   patch.antialiasedN(   R   Rw   Rx   R/   Ra   (   R   t   aa(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   P  s    c         C   s   |  i  |  S(   s   alias for set_antialiased(   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_antialiasedsZ  s    c         C   s   |  i  |  |  i |  d S(   s   
        Set both the edgecolor and the facecolor.

        ACCEPTS: matplotlib color arg or sequence of rgba tuples

        .. seealso::
            :meth:`set_facecolor`, :meth:`set_edgecolor`
        N(   R	   R   (   R   t   c(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt	   set_color^  s    	c         C   sF   | d j o t i d } n | |  _ t i i | |  i  |  _ d S(   s3  
        Set the facecolor(s) of the collection.  *c* can be a
        matplotlib color arg (all patches have same color), or a
        sequence or rgba tuples; if it is a sequence the patches will
        cycle through the sequence

        ACCEPTS: matplotlib color arg or sequence of rgba tuples
        s   patch.facecolorN(	   R   Rw   Rx   t   _facecolors_originalt   _colorst   colorConvertert   to_rgba_arrayt   _alphaRn   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR	   j  s    	 	c         C   s   |  i  |  S(   s   alias for set_facecolor(   R	   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_facecolorsw  s    c         C   s   |  i  S(   N(   Rn   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR]   {  s    c         C   s&   |  i  d j o |  i   S|  i  Sd  S(   Nt   face(   t   _edgecolorst   get_facecolors(   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR^     s    c         C   si   | d j o d |  _  d |  _ nC | d j o t i d } n | |  _ t i i | |  i  |  _  d S(   s  
        Set the edgecolor(s) of the collection. *c* can be a
        matplotlib color arg (all patches have same color), or a
        sequence or rgba tuples; if it is a sequence the patches will
        cycle through the sequence.

        If *c* is 'face', the edge color will always be the same as
        the face color.

        ACCEPTS: matplotlib color arg or sequence of rgba tuples
        R   s   patch.edgecolorN(	   R   t   _edgecolors_originalR   Rw   Rx   R   R   R   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    	 	c         C   s   |  i  |  S(   s   alias for set_edgecolor(   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_edgecolors  s    c         C   s   y t  |  Wn t j
 o t d   n Xt i i |  |  y" t i i |  i |  i	  |  _
 Wn t t t f j
 o n Xy6 |  i d j o" t i i |  i |  i	  |  _ n Wn t t t f j
 o n Xd S(   sz   
        Set the alpha tranparencies of the collection.  *alpha* must be
        a float.

        ACCEPTS: float
        s   alpha must be a floatR   N(   R(   R)   R   R   t	   set_alphaR   R   R   R   R   Rn   t   AttributeErrort
   IndexErrorR   R   (   R   t   alpha(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s       		c         C   s   |  i  S(   N(   R_   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_linewidths  s    c         C   s   |  i  S(   N(   R`   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_linestyles  s    c         C   s   |  i  d j o d S|  i  i d j o t d   n t |  i  o |  i |  i  |  i  |  _ n |  i |  i  |  i  |  _ d S(   sb   
        If the scalar mappable array is not none, update colors
        from scalar data
        Ni   s&   Collections can only map rank 1 arrays(	   t   _AR   t   ndimR   R   Rn   t   to_rgbaR   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRY     s     c         C   sw   t  i i |  |  | i |  _ | i |  _ | i |  _ | i |  _ | i |  _ | i |  _ | i	 |  _	 | i
 |  _
 d S(   s"   copy properties from other to selfN(   R   R   t   update_fromRa   R   R   R   Rn   R_   R`   R   (   R   t   other(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    N(6   RX   t
   __module__t   __doc__R   R   R   R   RD   RE   R   R2   t   zorderR   R   R-   R/   R1   R3   RC   RH   RT   Rf   Rq   Rr   Rs   R   Rt   Ru   Rv   R
   Rz   R{   R   R   R   R   R   R   R	   R   R]   R   R^   t   get_edgecolorsR   R   R   R   t   get_linewidthR   t
   get_dashest   get_linestyleRY   R   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR      sn   "!	
						 								
				*			
											
	s      Valid Collection keyword arguments:

        * *edgecolors*: None
        * *facecolors*: None
        * *linewidths*: None
        * *antialiaseds*: None
        * *offsets*: None
        * *transOffset*: transforms.IdentityTransform()
        * *norm*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)
        * *cmap*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)

    *offsets* and *transOffset* are used to translate the patch after
    rendering (default no offsets)

    If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds*
    are None, they default to their :data:`matplotlib.rcParams` patch
    setting, in sequence form.
t   QuadMeshc           B   sM   e  Z d  Z e d  Z d d  Z d   Z e e  Z d   Z	 d   Z
 RS(   s  
    Class for the efficient drawing of a quadrilateral mesh.

    A quadrilateral mesh consists of a grid of vertices. The
    dimensions of this array are (*meshWidth* + 1, *meshHeight* +
    1). Each vertex in the mesh has a different set of "mesh
    coordinates" representing its position in the topology of the
    mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
    and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
    (*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
    form one of the quadrilaterals in the mesh. There are thus
    (*meshWidth* * *meshHeight*) quadrilaterals in the mesh.  The mesh
    need not be regular and the polygons need not be convex.

    A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) *
    (*meshHeight* + 1))) numpy array *coordinates*, where each row is
    the *x* and *y* coordinates of one of the vertices.  To define the
    function that maps from a data point to its corresponding color,
    use the :meth:`set_cmap` method.  Each of these arrays is indexed in
    row-major order by the mesh coordinates of the vertex (or the mesh
    coordinates of the lower left vertex, in the case of the
    colors).

    For example, the first entry in *coordinates* is the
    coordinates of the vertex at mesh coordinates (0, 0), then the one
    at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
    so on.
    c         C   s   t  i |   | |  _ | |  _ | |  _ | |  _ | |  _ d  |  _ t	 i
 i   |  _ |  i i | i | d | d d f   |  i i | d | d d f  |  _ t i |  i t i  |  _ d  S(   Ni   i   (   R   R   t
   _meshWidtht   _meshHeightt   _coordinatest
   _showedgest   _antialiasedR   t   _pathsRD   t   Bboxt   unitt   _bboxt   update_from_data_xyt   reshapeR   R   R   (   R   t	   meshWidtht
   meshHeightt   coordinatest	   showedgest   antialiased(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    						&c         C   s<   |  i  d  j o% |  i |  i |  i |  i  |  _  n |  i  S(   N(   R   R   t   convert_mesh_to_pathsR   R   R   (   R   t	   dataTrans(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1     s    c      	   C   s   t  i } t i |  o | i } n | } t i | d d  d d  f | d d  d d  f | d d  d d  f | d d  d d  f | d d  d d  f f d d } | i |  | d d f  } g  } | D] } | | |  q ~ S(   s   
        Converts a given mesh into a sequence of
        :class:`matplotlib.path.Path` objects for easier rendering by
        backends that do not directly support quadmeshes.

        This function is primarily of use to backend implementers.
        i    ii   Nt   axisi   i   (   R9   RN   R    t   isMaskedArrayt   dataR   t   concatenateR   (   R   R   R   RN   R   t   pointsR@   Rl   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   &  s    		c         C   s   |  i  S(   N(   R   (   R   R=   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRC   @  s    c   
      C   s  |  i    p d  S| i |  i i  |  i   } |  i } |  i } |  i   oS t |  i  o? |  i	 |  i d   } |  i
 |  i d   } t | |  } q n t i | t i  } |  i d  o |  i   n |  i   \ } } | d  j	 o | i   } n | i pd |  i i |  i i d |  i i d d f  }	 | i |	  }	 |	 i |  i i  }	 t i   } n
 |  i }	 | i p | i |  } | i   } n | i | i   |  i | | |  i |  i  |	 | | |  i!   |  i" |  i#  | i$ |  i i  d  S(   Ni    i   R   i   (%   RU   RV   RW   RX   R4   R   R   RI   R   RK   RL   RO   R   R   R   t   check_updateRY   RZ   R   R;   R5   R   R   R   R>   RD   RE   R8   R7   t   draw_quad_meshR\   R   R   R]   R   R   Rc   (
   R   RF   R>   R"   R!   RR   RS   Rd   Re   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRf   C  sF     		
		

N(   RX   R   R   t   TrueR   R   R1   R   t   staticmethodRC   Rf   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s   		t   PolyCollectionc           B   sQ   e  Z d e d   Z e i e i  e i	 e _ e d  Z
 d   Z d   Z RS(   c         K   s-   t  i |  |  | |  _ |  i | |  d S(   s  
        *verts* is a sequence of ( *verts0*, *verts1*, ...) where
        *verts_i* is a sequence of *xy* tuples of vertices, or an
        equivalent :mod:`numpy` array of shape (*nv*, 2).

        *sizes* is *None* (default) or a sequence of floats that
        scale the corresponding *verts_i*.  The scaling is applied
        before the Artist master transform; if the latter is an identity
        transform, then the overall scaling is such that if
        *verts_i* specify a unit square, then *sizes_i* is the area
        of that square in points^2.
        If len(*sizes*) < *nv*, the additional values will be
        taken cyclically from the array.

        *closed*, when *True*, will explicitly close the polygon.

        %(Collection)s
        N(   R   R   t   _sizest	   set_verts(   R   t   vertst   sizest   closedR'   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   p  s    	c         C   s(  | o g  |  _  x| D] } t i i |  oO t |  o> | d | d j i   o# t i i | | d g g  } q nX t i |  } t |  o; | d | d j i   o  t i | | d g g  } n |  i  i t	 i
 |   q Wn. g  } | D] } | t	 i
 |  q~ |  _  d S(   s8   This allows one to delay initialization of the vertices.i    iN(   R   R   R    R   R   t   anyR   R   RM   R9   RN   (   R   R   R   t   xyR@   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    	 ('( !c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1     s    c         C   sq   |  i  d  j	 oQ g  } |  i  D]3 } | t i   i t i |  |  i i d  q ~ |  _	 n t
 i |  |  S(   Ng      R@(   R   R   RD   t   Affine2Dt   scaleR   t   sqrtt   figuret   dpiR2   R   Rf   (   R   RF   R@   Rl   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRf     s    JN(   RX   R   R   R   R   R*   t   dedentR   R   t   kwdocdR   R1   Rf   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   o  s
   	t   BrokenBarHCollectionc           B   sB   e  Z d  Z d   Z e i e i  e i e _ e d    Z	 RS(   s]   
    A collection of horizontal bars spanning *yrange* with a sequence of
    *xranges*.
    c      	   K   s   | \ } } | | } g  } | D]H \ } }	 | | | f | | f | |	 | f | |	 | f | | f g q! ~ }
 t  i |  |
 |  d S(   s   
        *xranges*
            sequence of (*xmin*, *xwidth*)

        *yrange*
            *ymin*, *ywidth*

        %(Collection)s
        N(   R   R   (   R   t   xrangest   yrangeR'   t   ymint   ywidtht   ymaxR@   t   xmint   xwidthR   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    

\c   
      K   s   g  } xa t  i |  D]P \ } } |  | | !} t |  p q n | i | d | d | d f  q Wt | | | | g |  }	 |	 S(   s&  
        Create a BrokenBarHCollection to plot horizontal bars from
        over the regions in *x* where *where* is True.  The bars range
        on the y-axis from *ymin* to *ymax*

        A :class:`BrokenBarHCollection` is returned.
        *kwargs* are passed on to the collection
        i    i(   t   mlabt   contiguous_regionsR   RM   R   (
   Rl   R   R   t   whereR'   R   t   ind0t   ind1t   xslicet
   collection(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt
   span_where  s    
 '(
   RX   R   R   R   R*   R   R   R   R   R   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s   	t   RegularPolyCollectionc           B   sr   e  Z d  Z e i i Z d d	 d  Z e i	 e i  e
 i e _ d   Z d   Z d   Z d   Z d   Z RS(
   s6   Draw a collection of regular polygons with *numsides*.i    i   c         K   sW   t  i |  |  | |  _ | |  _ |  i |  g |  _ | |  _ |  i t i	    d S(   s]  
        *numsides*
            the number of sides of the polygon

        *rotation*
            the rotation of the polygon in radians

        *sizes*
            gives the area of the circle circumscribing the
            regular polygon in points^2

        %(Collection)s

        Example: see :file:`examples/dynamic_collection.py` for
        complete example::

            offsets = np.random.rand(20,2)
            facecolors = [cm.jet(x) for x in np.random.rand(20)]
            black = (0,0,0,1)

            collection = RegularPolyCollection(
                numsides=5, # a pentagon
                rotation=0, sizes=(50,),
                facecolors = facecolors,
                edgecolors = (black,),
                linewidths = (1,),
                offsets = offsets,
                transOffset = ax.transData,
                )
        N(
   R   R   R   t	   _numsidest   _path_generatorR   t	   _rotationt   set_transformRD   RE   (   R   t   numsidest   rotationR   R'   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    #			c         C   sz   g  } |  i  D]P } | t i   i |  i  i t i |  |  i i	 d t i t i
   q ~ |  _ t i |  |  S(   Ng      R@(   R   RD   R   t   rotateR   R   R   R   R   R   t   piR2   R   Rf   (   R   RF   R@   Rl   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRf     s    cc         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1     s    c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_numsides  s    c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   get_rotation  s    c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt	   get_sizes  s    (   i   (   RX   R   R   R9   RN   t   unit_regular_polygonR   R   R*   R   R   R   Rf   R1   R   R   R   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s   '				t   StarPolygonCollectionc           B   s   e  Z d  Z e i i Z RS(   s?   
    Draw a collection of regular stars with *numsides* points.(   RX   R   R   R9   RN   t   unit_regular_starR   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s   t   AsteriskPolygonCollectionc           B   s   e  Z d  Z e i i Z RS(   sC   
    Draw a collection of regular asterisks with *numsides* points.(   RX   R   R   R9   RN   t   unit_regular_asteriskR   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s   t   LineCollectionc        
   B   sz   e  Z d  Z d Z d d d d d d d d d d 	 Z d   Z d   Z e Z d   Z	 d   Z
 d	   Z d
   Z e Z RS(   s  
    All parameters must be sequences or scalars; if scalars, they will
    be converted to sequences.  The property of the ith line
    segment is::

       prop[i % len(props)]

    i.e., the properties cycle if the ``len`` of props is less than the
    number of segments.
    i   R   i   c         K   s   | d j o t i d } n | d j o t i d f } n | d j o t i d f } n |  i |  t i i |  } t i |  d | d | d | d | d | d	 | d
 | d |	 d |
 | 	|  i	 g   |  i
 |  d S(   s  
        *segments*
            a sequence of (*line0*, *line1*, *line2*), where::

                linen = (x0, y0), (x1, y1), ... (xm, ym)

            or the equivalent numpy array with two columns. Each line
            can be a different length.

        *colors*
            must be a sequence of RGBA tuples (eg arbitrary color
            strings, etc, not allowed).

        *antialiaseds*
            must be a sequence of ones or zeros

        *linestyles* [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
            a string or dash tuple. The dash tuple is::

                (offset, onoffseq),

            where *onoffseq* is an even length tuple of on and off ink
            in points.

        If *linewidths*, *colors*, or *antialiaseds* is None, they
        default to their rcParams setting, in sequence form.

        If *offsets* and *transOffset* are not None, then
        *offsets* are transformed by *transOffset* and applied after
        the segments have been transformed to display coordinates.

        If *offsets* is not None but *transOffset* is None, then the
        *offsets* are added to the segments before any transformation.
        In this case, a single offset can be specified as::

            offsets=(xo,yo)

        and this value will be added cumulatively to each successive
        segment, so as to produce a set of successively offset curves.

        *norm*
            None (optional for :class:`matplotlib.cm.ScalarMappable`)
        *cmap*
            None (optional for :class:`matplotlib.cm.ScalarMappable`)

        *pickradius* is the tolerance for mouse clicks picking a line.
        The default is 5 pt.

        The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
        If the :class:`~matplotlib.cm.ScalarMappable` matrix
        :attr:`~matplotlib.cm.ScalarMappable._A` is not None (ie a call to
        :meth:`~matplotlib.cm.ScalarMappable.set_array` has been made), at
        draw time a call to scalar mappable will be made to set the colors.
        s   lines.colors   lines.linewidths   lines.antialiasedR   R   R   R    R!   R"   R#   R$   R%   N(   R   Rw   Rx   R   R   R   R   R   R   R   t   set_segments(   R   t   segmentsR   t   colorsR    R   R!   R"   R#   R$   R%   R'   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   ,  s,    B   c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1     s    c         C   s   | d  j o d  Sg  } xG | D]? } t i i |  p t i | t i  } n | i |  q W|  i d  j	 o |  i |  } n g  } | D] } | t	 i
 |  q ~ |  _ d  S(   N(   R   R   R    R   R   R   RM   R   t   _add_offsetsR9   RN   R   (   R   R   t	   _segmentst   segR@   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s      c         C   s   |  i  } t |  } | i d } | d j o1 xl t |  D] } | | | | | | <q< Wn? x; t |  D]- } | | } | | | | | d !| | <qm W| S(   Ni    i   (   R   R   R   t   range(   R   t   segsR!   t   Nsegst   Noffst   it   io(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    	  
!c         C   s   t  i i |  |  _ d S(   s4  
        Set the color(s) of the line collection.  *c* can be a
        matplotlib color arg (all patches have same color), or a
        sequence or rgba tuples; if it is a sequence the patches will
        cycle through the sequence

        ACCEPTS: matplotlib color arg or sequence of rgba tuples
        N(   R   R   R   R   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    	c         C   s   t  i d  |  i |  S(   s4  
        Set the color(s) of the line collection.  *c* can be a
        matplotlib color arg (all patches have same color), or a
        sequence or rgba tuples; if it is a sequence the patches will
        cycle through the sequence

        ACCEPTS: matplotlib color arg or sequence of rgba tuples
        s6   LineCollection.color deprecated; use set_color instead(   t   warningst   warnR   (   R   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   color  s    	c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt	   get_color  s    N(   RX   R   R   R   R   R   R1   R   R   R   R   R  R  t
   get_colors(    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR      s&   
P						t   CircleCollectionc           B   sE   e  Z d  Z d   Z e i e i  e i e _ d   Z d   Z	 RS(   s7   
    A collection of circles, drawn using splines.
    c         K   sE   t  i |  |  | |  _ |  i t i    t i i   g |  _	 d S(   sf   
        *sizes*
            Gives the area of the circle in points^2

        %(Collection)s
        N(
   R   R   R   R   RD   RE   R9   RN   t   unit_circleR   (   R   R   R'   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    	c         C   sm   g  } |  i  D]C } | t i   i t i |  |  i i d t i t i   q ~ |  _	 t
 i |  |  S(   Ng      R@(   R   RD   R   R   R   R   R   R   R   R2   R   Rf   (   R   RF   R@   Rl   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRf     s    Vc         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1     s    (
   RX   R   R   R   R*   R   R   R   Rf   R1   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR    s
   			t   EllipseCollectionc           B   sZ   e  Z d  Z d d  Z e i e i  e i e _ d   Z d   Z	 d   Z
 d   Z RS(   s8   
    A collection of ellipses, drawn using splines.
    R   c         K   s   t  i |  |  t i |  i   |  _ t i |  i   |  _ t i |  i   t i d |  _ | |  _	 |  i
 t i    g  |  _ t i i   g |  _ t |  _ d S(   s{  
        *widths*: sequence
            half-lengths of first axes (e.g., semi-major axis lengths)

        *heights*: sequence
            half-lengths of second axes

        *angles*: sequence
            angles of first axes, degrees CCW from the X-axis

        *units*: ['points' | 'inches' | 'dots' | 'width' | 'height' | 'x' | 'y']
            units in which majors and minors are given; 'width' and 'height'
            refer to the dimensions of the axes, while 'x' and 'y'
            refer to the *offsets* data units.

        Additional kwargs inherited from the base :class:`Collection`:

        %(Collection)s
        g     f@N(   R   R   R   R   t   ravelt   _widthst   _heightsR   t   _anglest   _unitsR   RD   RE   R2   R9   RN   R  R   Rj   t   _initialized(   R   t   widthst   heightst   anglest   unitsR'   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR     s    #		c            s2     f d   }   i  i i d |  t   _ d  S(   Nc            s   g    _  d  S(   N(   R2   (   t   fig(   R   (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   on_dpi_change   s    t   dpi_changed(   R   t	   callbackst   connectR   R  (   R   R  (    (   R   sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   _init  s    c         C   s  |  i  p |  i   n g  |  _ |  i } |  i } |  i d j oR |  i d j o | i i } | i i } n | i i	 } | i i	 } | | } n |  i d j o | i
 } n |  i d j o | i
 d } nn |  i d j o | i i } nN |  i d j o | i i	 } n. |  i d j o
 d	 } n t d
 |  i   t i } xb t |  i |  i |  i  D]E \ } } }	 |   i | | | |  i |	  }
 |  i i |
  qeWd  S(   NRl   Rm   t   inchesR   g      R@t   widtht   heightt   dotsg      ?s   unrecognized units: %s(   Rl   Rm   (   R  R  R2   t   axesR   R  t   viewLimR  RG   R  R   R   RD   R   RO   R	  R
  R  R   R   RM   (   R   t   axR  t   dx0t   dx1t   sct   _affineRl   Rm   t   at   trans(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   set_transforms  s8    
			
	 &c         C   s%   t  o |  i   n t i |  |  S(   N(   R   R%  R   Rf   (   R   RF   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyRf   &  s    c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1   +  s    (   RX   R   R   R   R*   R   R   R   R  R%  Rf   R1   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR    s   		!	t   PatchCollectionc           B   s#   e  Z d  Z e d  Z d   Z RS(   s   
    A generic collection of patches.

    This makes it easier to assign a color map to a heterogeneous
    collection of patches.

    This also may improve plotting speed, since PatchCollection will
    draw faster than a large number of patches.
    c         K   s.  | o d   } g  } | D] } | | |  q ~ } g  } | D] } | | i    qB ~ }	 g  }
 | D] } |
 | i   qi ~
 } g  } | D] } | | i   q ~ } t i |  d |	 d | d | d d d | n t i |  |  g  } | D]" } | | i   i | i    q ~ } | |  _ d S(	   s}  
        *patches*
            a sequence of Patch objects.  This list may include
            a heterogeneous assortment of different patch types.

        *match_original*
            If True, use the colors and linewidths of the original
            patches.  If False, new colors may be assigned by
            providing the standard collection arguments, facecolor,
            edgecolor, linewidths, norm or cmap.

        If any of *edgecolors*, *facecolors*, *linewidths*,
        *antialiaseds* are None, they default to their
        :data:`matplotlib.rcParams` patch setting, in sequence form.

        The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
        If the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not
        None (ie a call to set_array has been made), at draw time a
        call to scalar mappable will be made to set the face colors.
        c         S   s%   |  i  o |  i   Sd d d d g S(   Ni    (   t   fillR]   (   t   patch(    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   determine_facecolorP  s    
R   R   R   R   R   R    N(	   R^   R   t   get_antialiasedR   R   R4   t   transform_patht   get_pathR   (   R   t   patchest   match_originalR'   R)  R@   RA   R   t   _[2]R   t   _[3]R   t   _[4]R    t   _[5]R?   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR   9  s"    	''''/c         C   s   |  i  S(   N(   R   (   R   (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR1   i  s    (   RX   R   R   Rj   R   R1   (    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyR&  .  s   	0(,   R   t   copyt   mathR   t   numpyR   R    t
   matplotlibRw   t   matplotlib.cbookR*   t   matplotlib.colorsR   R   t   matplotlib.cmR   t   matplotlib.transformsRD   t   matplotlib.artistR   t   matplotlib.backend_basesR|   t   matplotlib.pathRQ   R9   t   matplotlib.mlabR   R   R   R   R   R   R   R   R   R   R   R   R  R  R&  t   kwdoct   patchstrt   k(    (    (    sF   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\collections.pyt   <module>
   s>   $ 5*DT? 