
 m[c        
   @` s  d  Z  d d l m Z m Z m Z m Z d d l Z d d l Z d d l m	 Z	 y d d l
 m Z Wn! e k
 r d d l m Z n Xd d l Z d d l Z d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z d e j e j   Z! i d	 g d
 6d g d 6Z" d e j# e j$ f d     YZ% e j& j' d 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!     YZ0 d" e( f d#     YZ1 d$ e% f d%     YZ2 d& e% f d'     YZ3 d( e% f d)     YZ4 d* e% f d+     YZ5 e j6 e%  Z7 xC d, d- d. d/ d0 d1 d2 d3 d4 d5 f
 D] Z8 e j& j' i e7 e8 6 qWe j& j' d e j6 e/   d S(6   ux  
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 large set of solid
line segemnts)
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   zip(   t   gcdi   (	   t   _patht   artistt   cbookt   cmt   colorst	   docstringt   linest   patht
   transformsg      ?u	   facecoloru
   facecolorsu	   edgecoloru
   edgecolorst
   Collectionc           B` sI  e  Z d  Z e j d8  Z e j   Z e j	 d9  Z
 e Z d: d: 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 e j 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, d$    Z- d%   Z. d&   Z/ d'   Z0 d(   Z1 d)   Z2 d*   Z3 d+   Z4 d,   Z5 d-   Z6 e6 Z7 d.   Z8 e8 Z9 d/   Z: d0   Z; d1   Z< d2   Z= d3   Z> e> Z? d4   Z@ e@ ZA ZB d5   ZC d6   ZD d7   ZE RS(;   u  
    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)]

    Exceptions are *capstyle* and *joinstyle* properties, these can
    only be set globally for the whole collection.

    Keyword arguments and default values:

        * *edgecolors*: None
        * *facecolors*: None
        * *linewidths*: None
        * *capstyle*:   None
        * *joinstyle*:  None
        * *antialiaseds*: None
        * *offsets*: None
        * *transOffset*: transforms.IdentityTransform()
        * *offset_position*: 'screen' (default) or 'data'
        * *norm*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)
        * *cmap*: None (optional for
          :class:`matplotlib.cm.ScalarMappable`)
        * *hatch*: None
        * *zorder*: 1


    *offsets* and *transOffset* are used to translate the patch after
    rendering (default no offsets).  If offset_position is 'screen'
    (default) the offset is applied after the master transform has
    been applied, that is, the offsets are in screen coordinates.  If
    offset_position is 'data', the offset is applied before the master
    transform, i.e., the offsets are in data coordinates.

    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
    (i.e., 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    i   i   u   solidg      @u   screeni   c         K` s  t  j j |   t j j |  |
 |  d g |  _ d g |  _ d g |  _ d g |  _	 t
 |  _ t j t j d  |  _ |  j |  |  j |  |  j |  |  j |  |  j |  |  j |  |  j |  |  j |  |  j |  |  j |  | r|  j |  n	 d |  _ | r/|  j |  n	 d |  _ t j  d  |  _! d |  _" | d k	 rt j# | t$  } | j% d	 k r| d d d  f } n  |	 d k	 r| |  _! |	 |  _& q| |  _" n  d |  _' |  j( |  d |  _) d S(
   u=   
        Create a Collection

        %(Collection)s
        i    u   hatch.colori   i   N(   NN(   NN(   i   i   (   i   (*   R   t   Artistt   __init__R	   t   ScalarMappablet   Nonet   _us_linestylest   _linestylest   _us_lwt   _linewidthst   Truet
   _is_filledt   mcolorst   to_rgbat   mplt   rcParamst   _hatch_colort   set_facecolort   set_edgecolort   set_linewidtht   set_linestylet   set_antialiasedt   set_pickradiust   set_urlst	   set_hatcht   set_offset_positiont
   set_zordert   set_capstylet	   _capstylet   set_joinstylet
   _joinstylet   npt   zerost   _offsetst   _uniform_offsetst
   asanyarrayt   floatt   shapet   _transOffsett   _path_effectst   updatet   _paths(   t   selft
   edgecolorst
   facecolorst
   linewidthst
   linestylest   capstylet	   joinstylet   antialiasedst   offsetst   transOffsett   normt   cmapt
   pickradiust   hatcht   urlst   offset_positiont   zordert   kwargs(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   b   sJ    						c         C` s   |  j  S(   N(   R7   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   get_paths   s    c         C` s
   t   d  S(   N(   t   NotImplementedError(   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   set_paths   s    c         C` s   |  j  S(   N(   t   _transforms(   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_transforms   s    c         C` sD   |  j  } t | t j  r@ t | d  r@ | j |  j  } n  | S(   Nu   _as_mpl_transform(   R4   t
   isinstanceR   t	   Transformt   hasattrt   _as_mpl_transformt   axes(   R8   t   t(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_offset_transform   s
    	c         C` s"  |  j    } |  j   } |  j } |  j   } | j sg g  | D] } | j |  ^ q= } | j   } n  | j s | j |  } | j   } n  t | t	 j
 j  r | j t	 j  } n  t |  rt |  rt j | j   | |  j   | | j    } | j |  } n t j j   } | S(   N(   t   get_transformRU   R/   RJ   t	   is_affinet   transform_path_non_affinet
   get_affinet   transform_non_affineRO   R-   t   mat   MaskedArrayt   filledt   nant   lent   mpatht   get_path_collection_extentst   frozenRN   t   inverse_transformedR   t   Bboxt   null(   R8   t	   transDatat	   transformRA   R@   t   pathst   pt   result(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_datalim   s&    		"	c         C` s   |  j  t j    S(   N(   Rk   R   t   IdentityTransform(   R8   t   renderer(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_window_extent   s    c   	      C` s  |  j    } |  j   } |  j } |  j   } |  j   r=g  } x |  j   D] } | j } | d d  d f | d d  d f } } |  j |  } |  j |  } | j t	 j
 t j | | g  | j   qL W| j d k r=|  j | d d  d f  } |  j | d d  d f  } t j | | g  } q=n  | j swg  | D] } | j |  ^ qM} | j   } n  | j s| j |  } | j   } n  t | t j j  r| j t j  } n  | | | | f S(   u&   Point prep for drawing and hit testingNi    i   (   RV   RU   R/   RJ   t
   have_unitst   verticest   convert_xunitst   convert_yunitst   appendR`   t   PathR-   t   column_stackt   codest   sizeRW   RX   RY   RZ   RO   R[   R\   R]   R^   (	   R8   Rg   RA   R@   Rh   R   Rp   t   xst   ys(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   _prepare_points   s4    		-/		c         C` s  |  j    s d  S| j |  j j |  j    |  j   |  j   \ } } } } | j   } |  j |  | j	 |  j
    |  j r | j |  j  y | j |  j  Wq t k
 r t j d  q Xn  |  j   d  k	 r | j |  j     n  |  j   r'd d l m } | |  j   |  } n  |  j   } |  j   }	 |  j   }
 t } t |  d k rwt |  d k rwt |	  d k rwt |
  d k rwt |  j  d k rw|  j d g k rwt |  j  d k rwt |  j   d k rw|  j!   d  k rwt |  r"t" j# | d  | } n | } | d j$ |  } | j%   \ } } | j& | k  rw| j' | k  rwt( } qwn  |  j) r| j* |  j)  n  |  j+ r| j, |  j+  n  | rX| j- t. |
 d   | j/ |  j d  | j0 |  j d   | j1 |  j d  | j2 |  j  d  | j3 | | d | j4   t5 j6 |  | t. |	 d   nX | j7 | | j4   | |  j   | | |  j   |  j   |  j |  j |  j |  j  |  j8  | j9   | j: |  j j  t |  _; d  S(   Nu6   Your backend does not support setting the hatch color.i    (   t   PathEffectRendereri   (   NN(<   t   get_visiblet
   open_groupt	   __class__t   __name__t   get_gidt   update_scalarmappableRz   t   new_gct   _set_gc_clipt   set_snapt   get_snapt   _hatchR&   t   set_hatch_colorR   t   AttributeErrort   warningst   warnt   get_sketch_paramsR   t   set_sketch_paramst   get_path_effectst   matplotlib.patheffectsR{   RN   t   get_facecolort   get_edgecolort   FalseR_   R   R   t   _antialiasedst   _urlst	   get_hatchR   t   Affine2Dt   get_extentst   get_canvas_width_heightt   widtht   heightR   R,   R+   R*   R)   t   set_foregroundt   tupleR!   t
   set_dashesR#   t   set_urlt   draw_markersRb   R`   Rt   t   draw_path_collectiont   _offset_positiont   restoret   close_groupt   stale(   R8   Rm   Rg   RA   R@   Rh   t   gcR{   t   transR:   R9   t   do_single_path_optimizationt   combined_transformt   extentsR   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   draw  sz    
	$$*
		#

c         C` s   | |  _  d S(   u   Set the pick radius used for containment tests.

        .. ACCEPTS: float distance in points

        Parameters
        ----------
        d : float
            Pick radius, in points.
        N(   t   _pickradius(   R8   t   pr(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR$   W  s    
c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_pickradiusc  s    c         C` s   t  |  j  r |  j |  |  S|  j   s5 t i  f St j |  j  re |  j t k	 re t |  j  n |  j	 } |  j
   \ } } } } t j | j | j | | j   | |  j   | | | d k |  j   
 } t |  d k t d |  f S(   u   
        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	   _containsR|   R   R   t
   is_numliket   _pickerR   R2   R   Rz   R   t   point_in_path_collectiont   xt   yRb   RN   t   get_offset_positionR_   t   dict(   R8   t
   mouseeventRD   Rg   RA   R@   Rh   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   containsf  s    
	c         C` s+   | d k	 r | n d g |  _ t |  _ d S(   uz   
        Parameters
        ----------
        urls : List[str] or None
            .. ACCEPTS: List[str] or None
        N(   R   R   R   R   (   R8   RF   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR%     s    c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_urls  s    c         C` s   | |  _  t |  _ d S(   uk  
        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.

        Unlike other properties such as linewidth and colors, hatching
        can only be specified for the collection as a whole, not separately
        for each member.

        ACCEPTS: [ '/' | '\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
        N(   R   R   R   (   R8   RE   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR&     s    	c         C` s   |  j  S(   u$   Return the current hatching pattern.(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` sk   t  j | t  } | j d k r: | d d d  f } n  |  j d k rU | |  _ n	 | |  _ t |  _ d S(   u   
        Set the offsets for the collection.  *offsets* can be a scalar
        or a sequence.

        ACCEPTS: float or sequence of floats
        i   N(   i   (	   R-   R1   R2   R3   R   R0   R/   R   R   (   R8   R@   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_offsets  s    	c         C` s!   |  j  d k r |  j S|  j  Sd S(   u&   Return the offsets for the collection.N(   R0   R   R/   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_offsets  s    c         C` s1   | d k r t  d   n  | |  _ t |  _ d S(   u  
        Set how offsets are applied.  If *offset_position* is 'screen'
        (default) the offset is applied after the master transform has
        been applied, that is, the offsets are in screen coordinates.
        If offset_position is 'data', the offset is applied before the
        master transform, i.e., the offsets are in data coordinates.

        .. ACCEPTS: [ 'screen' | 'data' ]
        u   screenu   datau*   offset_position must be 'screen' or 'data'N(   u   screenu   data(   t
   ValueErrorR   R   R   (   R8   RG   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR'     s    
	c         C` s   |  j  S(   u  
        Returns how offsets are applied for the collection.  If
        *offset_position* is 'screen', the offset is applied after the
        master transform has been applied, that is, the offsets are in
        screen coordinates.  If offset_position is 'data', the offset
        is applied before the master transform, i.e., the offsets are
        in data coordinates.
        (   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    	c         C` s   | d k r8 t j d } | d k r8 t j d } q8 n  t j t j |   |  _ |  j |  j |  j  \ |  _	 |  _
 t |  _ d S(   u   
        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
        u   patch.linewidthu   lines.linewidthN(   R   R   R   R-   t
   atleast_1dt   asarrayR   t   _bcast_lwlsR   R   R   R   R   (   R8   t   lw(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR!     s    c         C` s   |  j  |  S(   u   alias for set_linewidth(   R!   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_linewidths  s    c         C` s   |  j  |  S(   u   alias for set_linewidth(   R!   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_lw   s    c         C` s   y t  | t j  r? t j j | |  } t j |  g } nL y t j |  g } Wn3 t k
 r g  | D] } t j |  ^ ql } n XWn& t k
 r t d j	 |    n X| |  _
 |  j |  j |  j
  \ |  _ |  _ d S(   u  
        Set the linestyle(s) for the collection.

        ===========================   =================
        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)   Do not know how to convert {!r} to dashesN(   RO   t   sixt   string_typesR   t	   ls_mappert   gett   mlinest   _get_dash_patternR   t   formatR   R   R   R   R   (   R8   t   lst   dashesR   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR"     s    *	c         C` s,   | d k r | |  _  n t d |   d S(   u   
        Set the capstyle for the collection. The capstyle can
        only be set globally for all elements in the collection

        Parameters
        ----------
        cs : ['butt' | 'round' | 'projecting']
            The capstyle
        u   buttu   roundu
   projectingu!   Unrecognized cap style.  Found %sN(   u   buttu   roundu
   projecting(   R*   R   (   R8   t   cs(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR)   7  s    
c         C` s   |  j  S(   N(   R*   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_capstyleF  s    c         C` s,   | d k r | |  _  n t d |   d S(   u   
        Set the joinstyle for the collection. The joinstyle can only be
        set globally for all elements in the collection.

        Parameters
        ----------
        js : ['miter' | 'round' | 'bevel']
            The joinstyle
        u   miteru   roundu   bevelu"   Unrecognized join style.  Found %sN(   u   miteru   roundu   bevel(   R,   R   (   R8   t   js(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR+   I  s    
c         C` s   |  j  S(   N(   R,   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_joinstyleX  s    c         C` s   t  j d r |  | f St |  t |   k r t |  } t |   } t | |  } t |  | | } t |   | | }  n  g  t | |   D]' \ \ } } } t j | | |  ^ q } |  | f S(   u  Internal helper function to broadcast + scale ls/lw

        In the collection drawing code the linewidth and linestyle are
        cycled through as circular buffers (via v[i % len(v)]).  Thus,
        if we are going to scale the dash pattern at set time (not
        draw time) we need to do the broadcasting now and expand both
        lists to be the same length.

        Parameters
        ----------
        linewidths : list
            line widths of collection

        dashes : list
            dash specification (offset, (dash pattern tuple))

        Returns
        -------
        linewidths, dashes : list
             Will be the same length, dashes are scaled by paired linewidth

        u   _internal.classic_mode(   R   R   R_   R   t   listR   R   t   _scale_dashes(   R;   R   t   l_dashest   l_lwt   GCDt   ot   dR   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   [  s    
:c         C` s   |  j  |  S(   u   alias for set_linestyle(   R"   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_linestyles  s    c         C` s   |  j  |  S(   u   alias for set_linestyle(   R"   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` sG   | d k r t j d } n  t j t j | t   |  _ t |  _	 d S(   um   
        Set the antialiasing state for rendering.

        ACCEPTS: Boolean or sequence of booleans
        u   patch.antialiasedN(
   R   R   R   R-   R   R   t   boolR   R   R   (   R8   t   aa(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR#     s    c         C` s   |  j  |  S(   u   alias for set_antialiased(   R#   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_antialiaseds  s    c         C` s   |  j  |  |  j |  d S(   u  
        Set both the edgecolor and the facecolor.

        ACCEPTS: matplotlib color arg or sequence of rgba tuples

        .. seealso::

            :meth:`set_facecolor`, :meth:`set_edgecolor`
               For setting the edge or face color individually.
        N(   R   R    (   R8   t   c(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   set_color  s    c         C` s   | d  k r t j d } n  t |  _ y" | j   d k rF t |  _ n  Wn t k
 rZ n Xt j	 | |  j
  |  _ t |  _ d  S(   Nu   patch.facecoloru   none(   R   R   R   R   R   t   lowerR   R   R   t   to_rgba_arrayt   _alphat   _facecolorsR   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   _set_facecolor  s    	c         C` s   | |  _  |  j |  d S(   uc  
        Set the facecolor(s) of the collection.  *c* can be a
        matplotlib color spec (all patches have same color), or a
        sequence of specs; if it is a sequence the patches will
        cycle through the sequence.

        If *c* is 'none', the patch will not be filled.

        ACCEPTS: matplotlib color spec or sequence of specs
        N(   t   _original_facecolorR   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    	c         C` s   |  j  |  S(   u   alias for set_facecolor(   R   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_facecolors  s    c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s?   t  |  j t j  r4 |  j t d  k r4 |  j   S|  j Sd  S(   Nu   face(   RO   t   _edgecolorsR   R   t   strt   get_facecolors(   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    
c         C` s  t  } | d  k rQ t j d s2 |  j s2 |  j rB t j d } qQ d } t } n  t  |  _ y" | j   d k r{ t |  _ n  Wn t	 k
 r n Xy# | j   d k r d |  _
 d  SWn t	 k
 r n Xt j | |  j  |  _
 | rt |  j
  rt |  j
 d  |  _ n  t  |  _ d  S(   Nu   patch.force_edgecoloru   patch.edgecoloru   noneu   facei    (   R   R   R   R   R   t   _edge_defaultR   t   _is_strokedR   R   R   R   R   R   R_   R   R   R   (   R8   R   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   _set_edgecolor  s.    			c         C` s   | |  _  |  j |  d S(   u  
        Set the edgecolor(s) of the collection. *c* can be a
        matplotlib color spec (all patches have same color), or a
        sequence of specs; 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.  If it is 'none', the patch boundary will not
        be drawn.

        ACCEPTS: matplotlib color spec or sequence of specs
        N(   t   _original_edgecolorR   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR      s    	c         C` s   |  j  |  S(   u   alias for set_edgecolor(   R    (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_edgecolors  s    c         C` s   | d k	 r= y t |  Wq= t k
 r9 t d   q= Xn  t |  j d <t j j |  |  |  j |  j	  |  j
 |  j  d S(   u   
        Set the alpha tranparencies of the collection.  *alpha* must be
        a float or *None*.

        ACCEPTS: float or None
        u   alpha must be a float or Noneu   arrayN(   R   R2   t	   TypeErrorR   t   update_dictR   R   t	   set_alphaR   R   R   R   (   R8   t   alpha(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_linewidths  s    c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_linestyles  s    c         C` s   |  j  d k r d S|  j  j d k r4 t d   n  |  j d  sG d S|  j rn |  j |  j  |  j  |  _ n' |  j	 r |  j |  j  |  j  |  _
 n  t |  _ d S(   ub   
        If the scalar mappable array is not none, update colors
        from scalar data
        Ni   u&   Collections can only map rank 1 arraysu   array(   t   _AR   t   ndimR   t   check_updateR   R   R   R   R   R   R   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    		c         C` s   |  j  S(   u   return whether fill is set(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_fill-  s    c         C` s   t  j j |  |  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j	 |  _	 | j
 |  _
 | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ t |  _ d S(   u"   copy properties from other to selfN(   R   R   t   update_fromR   R   R   R   R   R   R   R   R   R   R   RB   RC   R   R   (   R8   t   other(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   1  s    (   i    i   (   i    i   i   N(F   R   t
   __module__t   __doc__R-   R.   R/   R   Rl   R4   t   emptyRM   R   R   R   R   RJ   RL   RN   RU   Rk   Rn   Rz   R   t   allow_rasterizationR   R$   R   R   R%   R   R&   R   R   R   R'   R   R!   R   R   R"   R)   R   R+   R   t   staticmethodR   R   R   R#   R   R   R   R   R   R   R   R   t   get_edgecolorsR   R    R   R   R   t   get_linewidthR   t
   get_dashest   get_linestyleR   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   $   s   /;							&U				
		!									3				(																
		u      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   _CollectionWithSizesc           B` s;   e  Z d  Z d Z d   Z d d  Z e j d    Z RS(   uA   
    Base class for collections that have an array of sizes.
    g      ?c         C` s   |  j  S(   u   
        Returns the sizes of the elements in the collection.  The
        value represents the 'area' of the element.

        Returns
        -------
        sizes : array
            The 'area' of each element.
        (   t   _sizes(   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   get_sizesg  s    
g      R@c         C` s   | d k r3 t j g   |  _ t j d  |  _ n t j |  |  _ t j t |  j  d d f  |  _ t j	 |  j  | d |  j
 } | |  j d d  d d f <| |  j d d  d d f <d |  j d d  d d f <t |  _ d S(	   uG  
        Set the sizes of each member of the collection.

        Parameters
        ----------
        sizes : ndarray or None
            The size to set for each element of the collection.  The
            value is the 'area' of the element.

        dpi : float
            The dpi of the canvas. Defaults to 72.0.
        i    i   g      R@Ni   g      ?i   (   i    i   i   (   R   R-   t   arrayR  R   RM   R   R.   R_   t   sqrtt   _factorR   R   (   R8   t   sizest   dpit   scale(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   set_sizess  s    $!c         C` s-   |  j  |  j |  j j  t j |  |  d  S(   N(   R
  R  t   figureR  R   R   (   R8   Rm   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    (	   R   R   R   R  R  R
  R   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR  a  s
   	t   PathCollectionc           B` s5   e  Z d  Z e j d d   Z d   Z d   Z RS(   u>   
    This is the most basic :class:`Collection` subclass.
    c         K` s7   t  j |  |  |  j |  |  j |  t |  _ d S(   us   
        *paths* is a sequence of :class:`matplotlib.path.Path`
        instances.

        %(Collection)s
        N(   R   R   RL   R
  R   R   (   R8   Rh   R  RI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    	c         C` s   | |  _  t |  _ d  S(   N(   R7   R   R   (   R8   Rh   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRL     s    	c         C` s   |  j  S(   N(   R7   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRJ     s    N(	   R   R   R   R   t   dedent_interpdR   R   RL   RJ   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s
   	t   PolyCollectionc           B` s;   e  Z e j d e d    Z e d  Z e Z d   Z	 RS(   c         K` s:   t  j |  |  |  j |  |  j | |  t |  _ d S(   u  
        *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   R
  t	   set_vertsR   R   (   R8   t   vertsR  t   closedRI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s}  t  | t j j  r3 | j t  j t j  } n  | rKg  |  _ x+| D] } t	 |  r+t  | t j j  r t j j
 | | d d !g  } n+ t j |  } t j
 | | d d !g  } t j | j d d t j j } t j j | (t j j | d <t j j | d <|  j j t j | |   qI |  j j t j |   qI Wn% g  | D] } t j |  ^ qR|  _ t |  _ d S(   u8   This allows one to delay initialization of the vertices.i    i   t   dtypeiN(   RO   R-   R[   R\   t   astypeR2   R]   R^   R7   R_   t   concatenateR   R   R3   R`   Rt   t	   code_typet   LINETOt   MOVETOt	   CLOSEPOLYRs   R   R   (   R8   R  R  t   xyRv   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s$    	"" %c         C` s   t  |  t  |  k r' t d   n  g  |  _ xa t | |  D]P \ } } t  |  rw |  j j t j | |   q@ |  j j t j |   q@ Wt |  _ d S(   u7   This allows one to initialize vertices with path codes.uB   'codes' must be a 1D list or array with the same length of 'verts'N(	   R_   R   R7   R   Rs   R`   Rt   R   R   (   R8   R  Rv   R  t   cds(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_verts_and_codes  s    	N(
   R   R   R   R  R   R   R   R  RL   R  (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s
   t   BrokenBarHCollectionc           B` s/   e  Z d  Z e j d    Z e d    Z RS(   u]   
    A collection of horizontal bars spanning *yrange* with a sequence of
    *xranges*.
    c   
      K` s   | \ } } | | } g  | D]G \ } } | | f | | f | | | f | | | f | | f g ^ q }	 t  j |  |	 |  d S(   u   
        *xranges*
            sequence of (*xmin*, *xwidth*)

        *yrange*
            *ymin*, *ywidth*

        %(Collection)s
        N(   R  R   (
   R8   t   xrangest   yrangeRI   t   ymint   ywidtht   ymaxt   xmint   xwidthR  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s
    
Qc   
      K` s   g  } x_ t  j |  D]N \ } } |  | | !} t |  sA q n  | j | d | d | d f  q Wt | | | | g |  }	 |	 S(   u(  
        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(   R   t   contiguous_regionsR_   Rs   R  (
   R   R  R!  t   whereRI   R  t   ind0t   ind1t   xslicet
   collection(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt
   span_where  s    
'(   R   R   R   R   R  R   R   R*  (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s   t   RegularPolyCollectionc           B` s\   e  Z d  Z e j j Z e Z e	 j
 d d d   Z d   Z d   Z e j d    Z RS(   u6   Draw a collection of regular polygons with *numsides*.i    i   c         K` s[   t  j |  |  |  j |  | |  _ |  j |  g |  _ | |  _ |  j t j	    d S(   u]  
        *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_generatorR7   t	   _rotationt   set_transformR   Rl   (   R8   t   numsidest   rotationR  RI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   $  s    $		c         C` s   |  j  S(   N(   R,  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_numsidesO  s    c         C` s   |  j  S(   N(   R.  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_rotationR  s    c         C` sh   |  j  |  j |  j j  g  |  j D]( } t j |  j |  j  j	   ^ q# |  _ t
 j |  |  d  S(   N(   R
  R  R  R  RM   R   R   t   rotateR.  t
   get_matrixR   R   (   R8   Rm   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   U  s    8(   i   (   R   R   R   R`   Rt   t   unit_regular_polygonR-  t   CIRCLE_AREA_FACTORR  R   R  R   R2  R3  R   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR+    s   '		t   StarPolygonCollectionc           B` s   e  Z d  Z e j j Z RS(   u?   
    Draw a collection of regular stars with *numsides* points.(   R   R   R   R`   Rt   t   unit_regular_starR-  (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR8  _  s   t   AsteriskPolygonCollectionc           B` s   e  Z d  Z e j j Z RS(   uC   
    Draw a collection of regular asterisks with *numsides* points.(   R   R   R   R`   Rt   t   unit_regular_asteriskR-  (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR:  f  s   t   LineCollectionc           B` s}   e  Z d  Z e Z d d d d d d d d d d d d  Z d   Z e Z e Z	 d   Z
 d   Z d	   Z d
   Z e Z RS(   u  
    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.
    u   solidi   i   u   nonec         K` s   | d k r t j d } n  | d k r; t j d f } n  | d k rZ t j d f } n  t j |  } t j |  d | d | d | d | d | d	 | d
 | d | d |	 d |
 d | | |  j |  d S(   u	  
        Parameters
        ----------
        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 : sequence, optional
            A sequence of RGBA tuples (e.g., arbitrary color
            strings, etc, not allowed).

        antialiaseds : sequence, optional
            A sequence of ones or zeros.

        linestyles : string, tuple, optional
            Either one of [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ], or
            a dash tuple. The dash tuple is::

                (offset, onoffseq)

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

        norm : Normalize, optional
            `~.colors.Normalize` instance.

        cmap : string or Colormap, optional
            Colormap name or `~.colors.Colormap` instance.

        pickradius : float, optional
            The tolerance in points for mouse clicks picking a line.
            Default is 5 pt.

        zorder : int, optional
           zorder of the LineCollection. Default is 2.

        facecolors : optional
           The facecolors of the LineCollection. Default is 'none'.
           Setting to a value other than 'none' will lead to a filled
           polygon being drawn between points on each line.

        Notes
        -----
        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.

        The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
        If the :class:`~matplotlib.cm.ScalarMappable` array
        :attr:`~matplotlib.cm.ScalarMappable._A` is not None (i.e., 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.
        u   lines.coloru   lines.linewidthu   lines.antialiasedR9   R:   R;   R<   R?   R@   RA   RB   RC   RD   RH   N(   R   R   R   R   R   R   R   t   set_segments(   R8   t   segmentsR;   R
   R?   R<   R@   RA   RB   RC   RD   RH   R:   RI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   {  s,    Sc         C` s   | d  k r d  Sg  } xE | D]= } t | t j j  sM t j | t  } n  | j |  q W|  j d  k	 r |  j	 |  } n  g  | D] } t
 j |  ^ q |  _ t |  _ d  S(   N(   R   RO   R-   R[   R\   R   R2   Rs   R0   t   _add_offsetsR`   Rt   R7   R   R   (   R8   R>  t	   _segmentst   segt   _seg(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR=    s    %c         C` s_   g  } xR |  j  D]G } g  | j   D] \ } } | ^ q# } t j |  } | j |  q W| S(   u   
        Returns
        -------
        segments : list
            List of segments in the LineCollection. Each list item contains an
            array of vertices.
        (   R7   t   iter_segmentsR-   R   Rs   (   R8   R>  R   t   vertext   _Rp   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_segments  s    %c         C` s   |  j  } t |  } | j d } | d k r^ xk t |  D] } | | | | | | <q; Wn> x; t |  D]- } | | } | | | | | d !| | <qk W| S(   Ni    i   (   R0   R_   R3   t   range(   R8   t   segsR@   t   Nsegst   Noffst   it   io(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR?    s    	
!c         C` s   |  j  |  t |  _ d S(   u(  
        Set the color(s) of the LineCollection.

        Parameters
        ----------
        c :
            Matplotlib color argument (all patches have same color), or a
            sequence or rgba tuples; if it is a sequence the patches will
            cycle through the sequence.
        N(   R    R   R   (   R8   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s   |  j  S(   N(   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt	   get_color'  s    N(   R   R   R   R   R   R   R   R=  R  RL   RF  R?  R   RM  t
   get_colors(    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR<  m  s*   
b					t   EventCollectionc           B` s   e  Z d  Z e Z d d d d d d d d  Z d   Z d   Z d   Z	 e	 Z
 Z d   Z d	   Z d
   Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   u	  
    A collection of discrete events.

    The events are given by a 1-dimensional array, usually the position of
    something along an axis, such as time or length.  They do not have an
    amplitude and are displayed as vertical or horizontal parallel bars.
    i    i   u   solidc	         K` s  | | d | | d f }
 | d k s: t |  d k rC g  } nt | d  rp | j d k rp t d   n | d k s | j   d k s | j   d k r | j   g  | D]% } g  |
 D] } | | f ^ q ^ q } t |  _ nf | j   d k rB| j   g  | D]% } g  |
 D] } | | f ^ q^ q} t	 |  _ n t d	   t
 j |  | d
 | d | d | d | |	 | |  _ | |  _ d S(   u   
        Parameters
        ----------
        positions : 1D array-like object
            Each value is an event.

        orientation : {None, 'horizontal', 'vertical'}, optional
            The orientation of the **collection** (the event bars are along
            the orthogonal direction). Defaults to 'horizontal' if not
            specified or None.

        lineoffset : scalar, optional, default: 0
            The offset of the center of the markers from the origin, in the
            direction orthogonal to *orientation*.

        linelength : scalar, optional, default: 1
            The total height of the marker (i.e. the marker stretches from
            ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).

        linewidth : scalar or None, optional, default: None
            If it is None, defaults to its rcParams setting, in sequence form.

        color : color, sequence of colors or None, optional, default: None
            If it is None, defaults to its rcParams setting, in sequence form.

        linestyle : str or tuple, optional, default: 'solid'
            Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
            '-', '--', '-.', ':']. Dash tuples should be of the form::

                (offset, onoffseq),

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

        antialiased : {None, 1, 2}, optional
            If it is None, defaults to its rcParams setting, in sequence form.

        **kwargs : optional
            Other keyword arguments are line collection properties.  See
            :class:`~matplotlib.collections.LineCollection` for a list of
            the valid properties.

        Examples
        --------

        .. plot:: gallery/lines_bars_and_markers/eventcollection_demo.py
        g       @i    u   ndimi   u:   positions cannot be an array with more than one dimension.u   noneu
   horizontalu   verticalu.   orientation must be 'horizontal' or 'vertical'R;   R
   R?   R<   N(   R   R_   RQ   R   R   R   t   sortR   t   _is_horizontalR   R<  R   t   _linelengtht   _lineoffset(   R8   t	   positionst   orientationt
   lineoffsett
   linelengtht	   linewidtht   colort	   linestylet   antialiasedRI   t   segmentR>  t   coord1t   coord2(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   8  s6    ;	
/
/		c         C` sV   |  j    } |  j   r d n d } g  } x% | D] } | j | d | f  q1 W| S(   uW   
        return an array containing the floating-point values of the positions
        i    i   (   RF  t   is_horizontalRs   (   R8   R>  t   posRT  R\  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_positions  s    c         C` s  | d k s- t | d  r> t |  d k r> |  j g   d S|  j   } |  j   } | | d | | d f } t j |  } | j   |  j	   r g  | D]% } g  | D] } | | f ^ q ^ q } n2 g  | D]% } g  | D] } | | f ^ q ^ q } |  j |  d S(   uH   
        set the positions of the events to the specified value
        u   leni    Ng       @(
   R   RQ   R_   R=  t   get_lineoffsett   get_linelengthR-   R1   RP  R_  (   R8   RT  RV  RW  R\  R]  R^  R>  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_positions  s     
2/c         C` sl   | d k s- t | d  r1 t |  d k r1 d S|  j   } t j | t j |  g  } |  j |  d S(   uC   
        add one or more events at the specified positions
        u   leni    N(   R   RQ   R_   Ra  R-   t   hstackR1   Rd  (   R8   t   positionRT  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   add_positions  s    c         C` s   |  j  S(   uN   
        True if the eventcollection is horizontal, False if vertical
        (   RQ  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR_    s    c         C` s   |  j    r d Sd S(   uf   
        get the orientation of the event line, may be:
        [ 'horizontal' | 'vertical' ]
        u
   horizontalu   vertical(   R_  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   get_orientation  s    c         C` sf   |  j    } x- t |  D] \ } } t j |  | | <q W|  j |  |  j   |  _ t |  _ d S(   uu   
        switch the orientation of the event line, either from vertical to
        horizontal or vice versus
        N(	   RF  t	   enumerateR-   t   fliplrR=  R_  RQ  R   R   (   R8   R>  RK  R\  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   switch_orientation  s    c         C` s   | d k s0 | j   d k s0 | j   d k r9 t } n' | j   d k rT t } n t d   | |  j   k rv d S|  j   d S(   u   
        set the orientation of the event line
        [ 'horizontal' | 'vertical' | None ]
        defaults to 'horizontal' if not specified or None
        u   noneu
   horizontalu   verticalu.   orientation must be 'horizontal' or 'vertical'N(   R   R   R   R   R   R_  Rk  (   R8   RU  R_  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_orientation  s    		c         C` s   |  j  S(   uE   
        get the length of the lines used to mark each event
        (   RR  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRc    s    c         C` s   | |  j    k r d S|  j   } |  j   } |  j   r@ d n d } x> | D]6 } | | d | d | f <| | d | d | f <qM W|  j |  | |  _ d S(   uE   
        set the length of the lines used to mark each event
        Ni   i    g       @(   Rc  Rb  RF  R_  R=  RR  (   R8   RW  RV  R>  R`  R\  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_linelength  s    c         C` s   |  j  S(   uE   
        get the offset of the lines used to mark each event
        (   RS  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRb    s    c         C` s   | |  j    k r d S|  j   } |  j   } |  j   r@ d n d } x> | D]6 } | | d | d | f <| | d | d | f <qM W|  j |  | |  _ d S(   uE   
        set the offset of the lines used to mark each event
        Ni   i    g       @(   Rb  Rc  RF  R_  R=  RS  (   R8   RV  RW  R>  R`  R\  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   set_lineoffset  s    c         C` s   |  j    d S(   uD   
        get the width of the lines used to mark each event
        i    (   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s
   |  j    S(   uz   
        get the style of the lines used to mark each event
        [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
        (   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    c         C` s   |  j    d S(   uD   
        get the color of the lines used to mark each event
        i    (   RN  (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRM  #  s    N(   R   R   R   R   R   R   R   Ra  Rd  Rg  t   extend_positionst   append_positionsR_  Rh  Rk  Rl  Rc  Rm  Rb  Rn  R   R   RM  (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRO  -  s0   S			

									t   CircleCollectionc           B` s&   e  Z d  Z e Z e j d    Z RS(   u7   
    A collection of circles, drawn using splines.
    c         K` sI   t  j |  |  |  j |  |  j t j    t j j   g |  _	 d S(   uf   
        *sizes*
            Gives the area of the circle in points^2

        %(Collection)s
        N(
   R   R   R
  R/  R   Rl   R`   Rt   t   unit_circleR7   (   R8   R  RI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   0  s    (   R   R   R   R7  R  R   R  R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRq  *  s   t   EllipseCollectionc           B` s>   e  Z d  Z e j d d   Z d   Z e j d    Z	 RS(   u8   
    A collection of ellipses, drawn using splines.
    u   pointsc         K` s   t  j |  |  d t j |  j   |  _ d t j |  j   |  _ t j |  j   |  _ | |  _	 |  j
 t j    t j d  |  _ t j j   g |  _ d S(   u  
        *widths*: sequence
            lengths of first axes (e.g., major axis lengths)

        *heights*: sequence
            lengths of second axes

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

        *units*: ['points' | 'inches' | 'dots' | 'width' | 'height'
        | 'x' | 'y' | 'xy']

            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. 'xy' differs
            from all others in that the angle as plotted varies with
            the aspect ratio, and equals the specified angle only when
            the aspect ratio is unity.  Hence it behaves the same as
            the :class:`~matplotlib.patches.Ellipse` with
            axes.transData as its transform.

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

        %(Collection)s
        g      ?i    i   N(   i    i   i   (   R   R   R-   R   t   ravelt   _widthst   _heightst   deg2radt   _anglest   _unitsR/  R   Rl   R   RM   R`   Rt   Rr  R7   (   R8   t   widthst   heightst   anglest   unitsRI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   B  s    	c   
      C` s  |  j  } |  j } |  j d k r* d } n |  j d k rR | j j | j j } n |  j d k rz | j j | j j } n |  j d k r | j } n |  j d k r | j d } ng |  j d k r | j j } nI |  j d	 k r | j j } n+ |  j d
 k rd } n t d |  j   t	 j
 t |  j  d d f  |  _ |  j | } |  j | } t	 j |  j  } t	 j |  j  } | | |  j d d  d d f <| | |  j d d  d d f <| | |  j d d  d d f <| | |  j d d  d d f <d |  j d d  d d f <t j } |  j d k r| j j   j   j   }	 d |	 d d  d d  f <|  j | |	   n  d S(   uB   
        Calculate transforms immediately before drawing.
        u   xyi   u   xu   yu   inchesu   pointsg      R@u   widthu   heightu   dotsg      ?u   unrecognized units: %si   Ni    i   (   RS   R  Ry  t   bboxR   t   viewLimR   R  R   R-   R.   R_   Ru  RM   Rv  t   sinRx  t   cosR   R   Rf   RY   R5  t   copyR/  (
   R8   t   axt   figt   scRz  R{  t	   sin_anglet	   cos_anglet   _affinet   m(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   _set_transformsg  sD    				$ !  	c         C` s   |  j    t j |  |  d  S(   N(   R  R   R   (   R8   Rm   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    
(
   R   R   R   R   R  R   R  R   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRs  >  s
   $	+t   PatchCollectionc           B` s#   e  Z d  Z e d  Z d   Z RS(   u   
    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   | r d   } g  | D] } | |  ^ q | d <g  | D] } | j    ^ q9 | d <g  | D] } | j   ^ q\ | d <g  | D] } | j   ^ q | d <g  | D] } | j   ^ q | d <n  t j |  |  |  j |  d S(   u  
        *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 (i.e., 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&   |  j    r |  j   Sd d d d g S(   Ni    (   R   R   (   t   patch(    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   determine_facecolor  s    
u
   facecolorsu
   edgecolorsu
   linewidthsu
   linestylesu   antialiasedsN(   R   R   R   t   get_antialiasedR   R   RL   (   R8   t   patchest   match_originalRI   R  Ri   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    	####&c         C` s;   g  | D]! } | j    j | j    ^ q } | |  _ d  S(   N(   RV   t   transform_patht   get_pathR7   (   R8   R  Ri   Rh   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRL     s    +(   R   R   R   R   R   RL   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s   	&t   TriMeshc           B` sJ   e  Z d  Z d   Z d   Z d   Z e d    Z e j	 d    Z
 RS(   u   
    Class for the efficient drawing of a triangular mesh using
    Gouraud shading.

    A triangular mesh is a :class:`~matplotlib.tri.Triangulation`
    object.
    c         K` s   t  j |  |  | |  _ d |  _ t |  _ t j j   |  _	 t
 j | j j d d  | j j d d  f  } |  j	 j |  d  S(   Nu   gouraudii   (   R   R   t   _triangulationt   _shadingR   R   R   Rd   t   unitt   _bboxR-   Re  R   t   reshapeR   t   update_from_data_xy(   R8   t   triangulationRI   R  (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s    			c         C` s#   |  j  d  k r |  j   n  |  j  S(   N(   R7   R   RL   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRJ     s    c         C` s   |  j  |  j  |  _ d  S(   N(   t   convert_mesh_to_pathsR  R7   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRL     s    c         C` su   t  j } |  j   } t j |  j | d t j f |  j | d t j f f d d } g  | D] } | |  ^ q_ S(   u   
        Converts a given mesh into a sequence of
        :class:`matplotlib.path.Path` objects for easier rendering by
        backends that do not directly support meshes.

        This function is primarily of use to backend implementers.
        .t   axisi   (   R`   Rt   t   get_masked_trianglesR-   R  R   t   newaxisR   (   t   triRt   t	   trianglesR  R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s
    		&c         C` s  |  j    s d  S| j |  j j  |  j   } |  j } | j   } t j | j	 | d t j
 f | j | d t j
 f f d d } |  j   |  j | } | j   } |  j |  | j |  j   d  | j | | | | j    | j   | j |  j j  d  S(   N.R  i   i    (   R|   R}   R~   R   RV   R  R  R-   R  R   R  R   R   R   R   R   R!   R   t   draw_gouraud_trianglesRb   R   R   (   R8   Rm   Rg   R  R  R  R
   R   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     s     	&

(   R   R   R   R   RJ   RL   R   R  R   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s   			t   QuadMeshc           B` sb   e  Z d  Z e d d  Z d   Z d   Z d   Z e d    Z	 d   Z
 e j d    Z RS(	   u  
    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.

    *shading* may be 'flat', or 'gouraud'
    u   flatc         K` s   t  j |  |  | |  _ | |  _ t j | t  j | d | d d f  |  _ | |  _	 | |  _
 t j j   |  _ |  j j | j | d | d d f   d  S(   Ni   i   (   R   R   t
   _meshWidtht   _meshHeightR-   R   R2   R  t   _coordinatest   _antialiasedR  R   Rd   R  R  R  (   R8   t	   meshWidtht
   meshHeightt   coordinatesR[  t   shadingRI   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR   4  s    				c         C` s#   |  j  d  k r |  j   n  |  j  S(   N(   R7   R   RL   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRJ   C  s    c         C` s.   |  j  |  j |  j |  j  |  _ t |  _ d  S(   N(   R  R  R  R  R7   R   R   (   R8   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRL   H  s    c         C` s   |  j    | j |  j  S(   N(   RV   t   transform_bboxR  (   R8   Rf   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyRk   M  s    c      	   C` s   t  j } t | t j j  r* | j } n | } t j | 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 } | j |  | d d f  } g  | D] } | |  ^ q S(   u   
        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   NR  i   i   (	   R`   Rt   RO   R-   R[   R\   t   dataR  R  (   R  R  R  Rt   R   t   pointsR   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR  P  s    			c         C` s  t  | t j j  r! | j } n | } | d d  d d  f } | d d  d d  f } | d d  d d  f } | d d  d d  f } | | | | d }	 t j | | |	 | | |	 | | |	 | | |	 f d d }
 |
 j | | d d d f  }
 |  j   j | d | d d f  } | d d  d d  f } | d d  d d  f } | d d  d d  f } | d d  d d  f } | | | | d } t j | | | | | | | | | | | | f d d } | j | | d d d f  } |
 | f S(	   u   
        Converts a given mesh into a sequence of triangles, each point
        with its own color.  This is useful for experiments using
        `draw_qouraud_triangle`.
        Nii   g      @R  i   i   i   (   RO   R-   R[   R\   R  R  R  R   (   R8   R  R  R  Ri   t   p_at   p_bt   p_ct   p_dt   p_centerR  R   t   c_at   c_bt   c_ct   c_dt   c_centerR
   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   convert_mesh_to_trianglesj  s:    				 &				 c         C` s;  |  j    s d  S| j |  j j |  j    |  j   } |  j   } |  j } |  j   r t	 |  j  r |  j
 |  j d  d   d f  } |  j |  j d  d   d f  } t j | | g  } q n  |  j   | j s|  j j d  } | j |  } | j |  j j  } t j   } n	 |  j } | j sO| j |  } | j   } n  | j   } |  j |  | j |  j   d  |  j d k r|  j |  j |  j |  \ }	 }
 | j  | |	 |
 | j!    nC | j" | | j!   |  j |  j | | | |  j#   |  j$ |  j%   
 | j&   | j' |  j j  t( |  _) d  S(   Ni    i   ii   u   gouraud(   ii   (*   R|   R}   R~   R   R   RV   RU   R/   Ro   R_   Rq   Rr   R-   Ru   R   RW   R  R  Rg   R3   R   Rl   RZ   RY   R   R   R!   R   R  R  R  R  R  Rb   t   draw_quad_meshR   R  R   R   R   R   R   (   R8   Rm   Rg   RA   R@   Rx   Ry   R  R   R  R
   (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR     sH    	""
			
(   R   R   R   R   R   RJ   RL   Rk   R   R  R  R   R   R   (    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyR    s   				*u   QuadMeshu   TriMeshu   PolyCollectionu   BrokenBarHCollectionu   RegularPolyCollectionu   PathCollectionu   StarPolygonCollectionu   PatchCollectionu   CircleCollectionu
   Collection(9   R   t
   __future__R    R   R   R   R   R   t	   six.movesR   t   mathR   t   ImportErrort	   fractionst   numpyR-   t
   matplotlibR   t    R   R   R   R	   R
   R   R   R   R   R   R`   R   R  t   piR7  t   _color_aliasesR   R   R   t   interpdR6   R  R  R  R  R+  R8  R:  R<  RO  Rq  Rs  R  R  R  t   kwdoct   patchstrt   k(    (    (    s5   lib/python2.7/site-packages/matplotlib/collections.pyt   <module>
   sR   "@   )1C/AZ7F