
t,2Jc           @   s  d  Z  d d k Z d d k l Z d d k l Z d d k l Z d d k l	 Z	 d d k
 Z
 y e Wn# e j
 o d d k l Z n Xd d k Z d d k l Z d d	 k l Z l Z e Z e o d d k
 Z
 n e i Z 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" d e f d     YZ# d  e  f d!     YZ$ d"   Z% d# e f d$     YZ& d% e  f d&     YZ' d'   Z( d( e  f d)     YZ) d* e  f d+     YZ* d, e  f d-     YZ+ d. e  f d/     YZ, d0 e f d1     YZ- d2 d3 e. d4  Z/ d5   Z0 d6   Z1 d7 d7 d8 d9  Z2 d S(:   s  
matplotlib includes a framework for arbitrary geometric
transformations that is used determine the final position of all
elements drawn on the canvas.

Transforms are composed into trees of :class:`TransformNode` objects
whose actual value depends on their children.  When the contents of
children change, their parents are automatically invalidated.  The
next time an invalidated transform is accessed, it is recomputed to
reflect those changes.  This invalidation/caching approach prevents
unnecessary recomputations of transforms, and contributes to better
interactive performance.

For example, here is a graph of the transform tree used to plot data
to the graph:

.. image:: ../_static/transforms.png

The framework can be used for both affine and non-affine
transformations.  However, for speed, we want use the backend
renderers to perform affine transformations whenever possible.
Therefore, it is possible to perform just the affine or non-affine
part of a transformation on a set of data.  The affine is always
assumed to occur after the non-affine.  For any transform::

  full transform == non-affine part + affine part

The backends are not expected to handle non-affine transformations
themselves.
iN(   t   ma(   t   affine_transform(   t   inv(   t   WeakKeyDictionary(   t   Set(   t   Path(   t   count_bboxes_overlapping_bboxt   update_path_extentst   TransformNodec           B   s   e  Z d  Z d Z d Z d Z e e BZ e Z e Z	 e Z
 d   Z d   Z e Z d   Z d   Z e o e Z d   Z e i e _ n d	   Z e o g  d
  Z n g  d  Z RS(   sE  
    :class:`TransformNode` is the base class for anything that
    participates in the transform tree and needs to invalidate its
    parents or be invalidated.  This includes classes that are not
    really transforms, such as bounding boxes, since some transforms
    depend on bounding boxes to compute their values.
    i    i   i   c         C   s   t    |  _ d |  _ d S(   s7   
        Creates a new :class:`TransformNode`.
        i   N(   R   t   _parentst   _invalid(   t   self(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __init__P   s    c         G   s   t  d d   d  S(   Ns+   TransformNode instances can not be copied. s    Consider using frozen() instead.(   t   NotImplementedError(   R   t   args(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __copy__]   s    c         C   s   |  i  o
 |  i p |  i } |  i | j o d St |  i  p | |  _ d S|  g } x^ t |  oP | i   } | i | j p
 | i o& |  i | _ | i | i i	    q\ q\ Wd S(   s   
        Invalidate this :class:`TransformNode` and all of its
        ancestors.  Should be called any time the transform changes.
        N(
   t	   is_affinet   INVALID_AFFINEt   INVALIDR
   t   lenR	   t   popt   pass_throught   extendt   keys(   R   t   valuet   stackt   root(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   invalidatec   s    		 c         G   s"   x | D] } d | i |  <q Wd S(   s   
        Set the children of the transform, to let the invalidation
        system know which transforms can invalidate this transform.
        Should be called from the constructor of any transforms that
        depend on other transforms.
        N(   t   NoneR	   (   R   t   childrent   child(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   set_children~   s     c         G   s   |  i  |   | |  _ d  S(   N(   t   _set_childrent	   _children(   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR      s    c         C   s   |  S(   s   
        Returns a frozen copy of this transform node.  The frozen copy
        will not update when its children change.  Useful for storing
        a previously known state of a transform where
        ``copy.deepcopy()`` might normally be used.
        (    (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   frozen   s    c            sI   t          f d      i d    |    i d  d S(   s  
            For debugging purposes.

            Writes the transform tree rooted at 'self' to a graphviz "dot"
            format file.  This file can be run through the "dot" utility
            to produce a graph of the transform tree.

            Affine transforms are marked in blue.  Bounding boxes are
            marked in yellow.

            *fobj*: A Python file-like object
            c      
      ss  |   j o d  S i  |   h  } |  i i } |  i o d | } n |   j o d | d <n d | d <d | | d <d i g  } | i   D] \ } } | d	 | | f q ~  }  i d
 t |   | f  t |  d  o x |  i	 D]t } d } x5 |  i
 i   D]$ \ } } | | j o | } PqqW i d t |   t |  | f    |  q Wn d  S(   Ns   [%s]t   boldt   stylet   boxt   shapes   "%s"t   labelt    s   %s=%ss	   %s [%s];
R!   t   ?s$   %s -> %s [label="%s", fontsize=10];
(   t   addt	   __class__t   __name__R
   t   joint   itemst   writet   hasht   hasattrR!   t   __dict__(   R   t   propsR'   t   _[1]t   keyt   valR   t   name(   t   recurset   fobjt   seent	   highlight(    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR8      s8    

@	
  				s   digraph G {
s   }
N(   t   setR/   (   R   R9   R;   (    (   R8   R9   R;   R:   sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   write_graphviz   s
    	
c         C   s   d  S(   N(    (   R   R9   R;   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR=      s    (   R,   t
   __module__t   __doc__t   _gidt   INVALID_NON_AFFINER   R   t   FalseR   t   is_bboxR   R   R   t   __deepcopy__R   R   t   DEBUGR    R"   R=   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   6   s*   
				
			1t   BboxBasec           B   s  e  Z d  Z e Z e Z e o d   Z e e  Z n d   Z	 e
 i e	 _ d   Z d   Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z d	   Z e e dO dO d
  Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z d   Z e e dO dO d  Z  d   Z! e e! dO dO d  Z" d   Z# e e# dO dO d  Z$ d   Z% e e% dO dO d  Z& d   Z' e e' dO dO d  Z( d   Z) e e) dO dO d   Z* d!   Z+ e e+ dO dO d"  Z, d#   Z- e e- dO dO d$  Z. d%   Z/ e e/ dO dO d&  Z0 d'   Z1 e e1 dO dO d(  Z2 d)   Z3 e e3 dO dO d*  Z4 d+   Z5 d,   Z6 d-   Z7 d.   Z8 d/   Z9 d0   Z: d1   Z; d2   Z< d3   Z= d4   Z> d5   Z? h	 dP d7 6dQ d9 6dR d: 6dS d< 6dT d= 6dU d> 6dV d? 6dW d@ 6dX dA 6Z@ dO dB  ZA dC   ZB dO d; dD  ZC dE   ZD dF   ZE dG   ZF dH   ZG dI   ZH dJ   ZI dK   ZJ dL   ZK dM   ZL dN   ZM e eM  ZM RS(Y   s  
    This is the base class of all bounding boxes, and provides
    read-only access to its data.  A mutable bounding box is provided
    by the :class:`Bbox` class.

    The canonical representation is as two points, with no
    restrictions on their ordering.  Convenience properties are
    provided to get the left, bottom, right and top edges and width
    and height, but these are not stored explicity.
    c         C   sw   t  i |   o t i d  n t i |   }  |  d |  d d j p |  d |  d d j o t i d  n d  S(	   Ns   Bbox bounds are a masked array.i   i    s   Singular Bbox.(   i   i    (   i    i    (   i   i   (   i    i   (   R    t   isMaskedArrayt   warningst   warnt   npt   asarray(   t   points(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _check   s    c         C   s   t  |  i   i    S(   N(   t   Bboxt
   get_pointst   copy(   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"      s    c         O   s
   |  i    S(   N(   RO   (   R   R   t   kwargs(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   __array__   s    c         C   s(   t  |  i   i    d d d d g j S(   sk   
        Returns True if the :class:`Bbox` is the unit bounding box
        from (0, 0) to (1, 1).
        g        g      ?(   t   listRO   t   flatten(   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   is_unit   s    c         C   s   |  i    d S(   Ni    (   i    i    (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_x0   s    s   
         (property) :attr:`x0` is the first of the pair of *x* coordinates that
         define the bounding box.  :attr:`x0` is not guaranteed to be
         less than :attr:`x1`.  If you require that, use :attr:`xmin`.c         C   s   |  i    d S(   Ni    i   (   i    i   (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_y0   s    s   
         (property) :attr:`y0` is the first of the pair of *y* coordinates that
         define the bounding box.  :attr:`y0` is not guaranteed to be
         less than :attr:`y1`.  If you require that, use :attr:`ymin`.c         C   s   |  i    d S(   Ni   i    (   i   i    (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_x1  s    s   
         (property) :attr:`x1` is the second of the pair of *x* coordinates that
         define the bounding box.  :attr:`x1` is not guaranteed to be
         greater than :attr:`x0`.  If you require that, use :attr:`xmax`.c         C   s   |  i    d S(   Ni   (   i   i   (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_y1  s    s   
         (property) :attr:`y1` is the second of the pair of *y* coordinates that
         define the bounding box.  :attr:`y1` is not guaranteed to be
         greater than :attr:`y0`.  If you require that, use :attr:`ymax`.c         C   s   |  i    d S(   Ni    (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_p0  s    s   
         (property) :attr:`p0` is the first pair of (*x*, *y*) coordinates that
         define the bounding box.  It is not guaranteed to be the bottom-left
         corner.  For that, use :attr:`min`.c         C   s   |  i    d S(   Ni   (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_p1  s    s   
         (property) :attr:`p1` is the second pair of (*x*, *y*) coordinates that
         define the bounding box.  It is not guaranteed to be the top-right
         corner.  For that, use :attr:`max`.c         C   s    t  |  i   d  d   d f  S(   Ni    (   t   minRO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   _get_xmin#  s    sF   
        (property) :attr:`xmin` is the left edge of the bounding box.c         C   s    t  |  i   d  d   d f  S(   Ni   (   R\   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   _get_ymin(  s    sH   
        (property) :attr:`ymin` is the bottom edge of the bounding box.c         C   s    t  |  i   d  d   d f  S(   Ni    (   t   maxRO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   _get_xmax-  s    sG   
        (property) :attr:`xmax` is the right edge of the bounding box.c         C   s    t  |  i   d  d   d f  S(   Ni   (   R_   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   _get_ymax2  s    sE   
        (property) :attr:`ymax` is the top edge of the bounding box.c         C   sB   t  |  i   d  d   d f  t  |  i   d  d   d f  g S(   Ni    i   (   R\   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_min7  s    sV   
        (property) :attr:`min` is the bottom-left corner of the bounding
        box.c         C   sB   t  |  i   d  d   d f  t  |  i   d  d   d f  g S(   Ni    i   (   R_   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_max>  s    sL   
        (property) :attr:`max` is the top-right corner of the bounding box.c         C   s   |  i    d  d   d f S(   Ni    (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_intervalxD  s    s   
        (property) :attr:`intervalx` is the pair of *x* coordinates that define
        the bounding box. It is not guaranteed to be sorted from left to
        right.c         C   s   |  i    d  d   d f S(   Ni   (   RO   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_intervalyK  s    s   
        (property) :attr:`intervaly` is the pair of *y* coordinates that define
        the bounding box.  It is not guaranteed to be sorted from bottom to
        top.c         C   s   |  i    } | d | d S(   Ni   i    (   i   i    (   i    i    (   RO   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   _get_widthR  s    sj   
        (property) The width of the bounding box.  It may be negative if
        :attr:`x1` < :attr:`x0`.c         C   s   |  i    } | d | d S(   Ni   i    (   i   i   (   i    i   (   RO   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_heightY  s    sk   
        (property) The height of the bounding box.  It may be negative if
        :attr:`y1` < :attr:`y0`.c         C   s   |  i    } | d | d S(   Ni   i    (   RO   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   _get_size`  s    s   
        (property) The width and height of the bounding box.  May be negative,
        in the same way as :attr:`width` and :attr:`height`.c         C   s6   |  i    i   \ } } } } | | | | | | f S(   N(   RO   RT   (   R   t   x0t   y0t   x1t   y1(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_boundsg  s    s\   
        (property) Returns (:attr:`x0`, :attr:`y0`, :attr:`width`,
        :attr:`height`).c         C   s   |  i    i   i   S(   N(   RO   RT   RP   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_extentsn  s    sM   
        (property) Returns (:attr:`x0`, :attr:`y0`, :attr:`x1`, :attr:`y1`).c         C   s   t    S(   N(   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRO   s  s    c         C   sM   |  i  \ } } | | j  o | | j o | | j p | | j o
 | | j S(   s_   
        Returns True if *x* is between or equal to :attr:`x0` and
        :attr:`x1`.
        (   t	   intervalx(   R   t   xRi   Rk   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   containsxv  s    c         C   sM   |  i  \ } } | | j  o | | j o | | j p | | j o
 | | j S(   s_   
        Returns True if *y* is between or equal to :attr:`y0` and
        :attr:`y1`.
        (   t	   intervaly(   R   t   yRj   Rl   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   containsy  s    c         C   s   |  i  |  o |  i |  S(   sn   
        Returns *True* if (*x*, *y*) is a coordinate inside the
        bounding box or on its edge.
        (   Rq   Rt   (   R   Rp   Rs   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   contains  s    c   
      C   s   |  i    \ } } } } | i    \ } } } }	 | | j  o | | } } n | | j  o | | } } n | | j  o | | } } n |	 | j  o | |	 }	 } n | | j  p$ |	 | j  p | | j p
 | | j S(   si   
        Returns True if this bounding box overlaps with the given
        bounding box *other*.
        (   Rn   (
   R   t   othert   ax1t   ay1t   ax2t   ay2t   bx1t   by1t   bx2t   by2(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   overlaps  s    c         C   sM   |  i  \ } } | | j  o | | j o | | j  p | | j o
 | | j  S(   sd   
        Returns True if *x* is between but not equal to :attr:`x0` and
        :attr:`x1`.
        (   Ro   (   R   Rp   Ri   Rk   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   fully_containsx  s    c         C   sM   |  i  \ } } | | j  o t | j o t | j  p t | j o
 t | j  S(   sd   
        Returns True if *y* is between but not equal to :attr:`y0` and
        :attr:`y1`.
        (   Rr   Rp   (   R   Rs   Rj   Rl   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   fully_containsy  s    c         C   s   |  i  |  o |  i |  S(   sr   
        Returns True if (*x*, *y*) is a coordinate inside the bounding
        box, but not on its edge.
        (   R   R   (   R   Rp   Rs   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   fully_contains  s    c   
      C   s   |  i    \ } } } } | i    \ } } } }	 | | j  o | | } } n | | j  o | | } } n | | j  o | | } } n |	 | j  o | |	 }	 } n | | j p$ |	 | j p | | j p
 | | j S(   s   
        Returns True if this bounding box overlaps with the given
        bounding box *other*, but not on its edge alone.
        (   Rn   (
   R   Rv   Rw   Rx   Ry   Rz   R{   R|   R}   R~   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   fully_overlaps  s    c         C   s   t  | i |  i     S(   sk   
        Return a new :class:`Bbox` object, statically transformed by
        the given transform.
        (   RN   t	   transformRO   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transformed  s    c         C   s   t  | i   i |  i     S(   sz   
        Return a new :class:`Bbox` object, statically transformed by
        the inverse of the given transform.
        (   RN   t   invertedR   RO   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   inverse_transformed  s    g      ?t   Ci    t   SWt   Sg      ?t   SEt   Et   NEt   Nt   NWt   Wc         C   s   | d j o
 |  } n | i \ } } } } t | t  o |  i | \ } } n | \ } } |  i \ }	 }
 } } t |  i | | | | |	 | | | | |
 g  S(   sS  
        Return a copy of the :class:`Bbox`, shifted to position *c*
        within a container.

        *c*: may be either:

          * a sequence (*cx*, *cy*) where *cx* and *cy* range from 0
            to 1, where 0 is left or bottom and 1 is right or top

          * a string:
            - 'C' for centered
            - 'S' for bottom-center
            - 'SE' for bottom-left
            - 'E' for left
            - etc.

        Optional argument *container* is the box within which the
        :class:`Bbox` is positioned; it defaults to the initial
        :class:`Bbox`.
        N(   R   t   boundst
   isinstancet   strt   coefsRN   t   _points(   R   t   ct	   containert   lt   bt   wt   ht   cxt   cyt   Lt   BR   t   H(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   anchored  s    
	c         C   s?   |  i  \ } } t |  i d |  i d | | | | g g  S(   s!  
        Return a copy of the :class:`Bbox`, shrunk by the factor *mx*
        in the *x* direction and the factor *my* in the *y* direction.
        The lower left corner of the box remains unchanged.  Normally
        *mx* and *my* will be less than 1, but this is not enforced.
        i    (   t   sizeRN   R   (   R   t   mxt   myR   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   shrunk  s    c         C   s   | d j o
 |  } n | i \ } } | | | } | | j o
 | } n | | | } | } t |  i d |  i d | | f g  S(   s  
        Return a copy of the :class:`Bbox`, shrunk so that it is as
        large as it can be while having the desired aspect ratio,
        *box_aspect*.  If the box coordinates are relative---that
        is, fractions of a larger box such as a figure---then the
        physical aspect ratio of that figure is specified with
        *fig_aspect*, so that *box_aspect* can also be given as a
        ratio of the absolute dimensions, not the relative dimensions.
        i    N(   R   R   RN   R   (   R   t
   box_aspectR   t
   fig_aspectR   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   shrunk_to_aspect  s    

c      	   G   s   g  } d g t  |  d g } |  i   \ } } } } | | } xZ t | d  | d  D]A \ }	 }
 | i t | |	 | | g | |
 | | g g   qZ W| S(   s   
        e.g., ``bbox.splitx(f1, f2, ...)``

        Returns a list of new :class:`Bbox` objects formed by
        splitting the original one with vertical lines at fractional
        positions *f1*, *f2*, ...
        i    i   i(   RS   Rn   t   zipt   appendRN   (   R   R   t   boxest   xfRi   Rj   Rk   Rl   R   t   xf0t   xf1(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   splitx3  s    
 9c      
   G   s   g  } d g t  |  d g } |  i   \ } } } } | | } xZ t | d  | d  D]A \ }	 }
 | i t | | |	 | g | | |
 | g g   qZ W| S(   s   
        e.g., ``bbox.splitx(f1, f2, ...)``

        Returns a list of new :class:`Bbox` objects formed by
        splitting the original one with horizontal lines at fractional
        positions *f1*, *f2*, ...
        i    i   i(   RS   Rn   R   R   RN   (   R   R   R   t   yfRi   Rj   Rk   Rl   R   t   yf0t   yf1(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   splityC  s    
 9c         C   s   t  |  d j o d St i |  } |  i   \ } } } } t i | d d  d f |  } t i | d d  d f |  } t i | d d  d f |  } t i | d d  d f |  }	 t | |  t | |	  d j }
 t i |
  S(   sx   
        Count the number of vertices contained in the :class:`Bbox`.

        *vertices* is a Nx2 Numpy array.
        i    Ni   i   (   R   RJ   RK   Rn   t   signt   abst   sum(   R   t   verticesRi   Rj   Rk   Rl   t   dx0t   dy0t   dx1t   dy1t   inside(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   count_containsS  s    ####$c         C   s   t  |  |  S(   s   
        Count the number of bounding boxes that overlap this one.

        bboxes is a sequence of :class:`BboxBase` objects
        (   R   (   R   t   bboxes(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   count_overlapsd  s    c         C   sj   |  i  } |  i } | | | d } | | | d } t i | | g | | g g  } t |  i |  S(   s   
        Return a new :class:`Bbox` which is this :class:`Bbox`
        expanded around its center by the given factors *sw* and
        *sh*.
        g       @(   t   widtht   heightRJ   t   arrayRN   R   (   R   t   swt   shR   R   t   deltawt   deltaht   a(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   expandedl  s    		#c         C   s+   |  i  } t | | | g | | g g  S(   si   
        Return a new :class:`Bbox` that is padded on all four sides by
        the given value.
        (   R   RN   (   R   t   pRL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   paddedy  s    	c         C   s   t  |  i | | f  S(   se   
        Return a copy of the :class:`Bbox`, statically translated by
        *tx* and *ty*.
        (   RN   R   (   R   t   txt   ty(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   translated  s    c         C   sO   |  i    i   \ } } } } t i | | g | | g | | g | | g g  S(   s  
        Return an array of points which are the four corners of this
        rectangle.  For example, if this :class:`Bbox` is defined by
        the points (*a*, *b*) and (*c*, *d*), :meth:`corners` returns
        (*a*, *b*), (*a*, *d*), (*c*, *b*) and (*c*, *d*).
        (   RO   RT   RJ   R   (   R   R   R   t   rt   t(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   corners  s    c         C   sJ   |  i    } t   i |  i |  } t i   } | i | d t | S(   s   
        Return a new bounding box that bounds a rotated version of
        this bounding box by the given radians.  The new bounding box
        is still aligned with the axes, of course.
        t   ignore(   R   t   Affine2Dt   rotateR   RN   t   unitt   update_from_data_xyt   True(   R   t   radiansR   t   corners_rotatedt   bbox(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   rotated  s
    c   	      C   s  t  |   d j o	 |  d St i } t i } t i } t i } x |  D] } | i   } | d d  d f } | d d  d f } t | t i |   } t | t i |   } t | t i |   } t | t i |   } qI Wt i | | | |  S(   sO   
        Return a :class:`Bbox` that contains all of the given bboxes.
        i   i    N(   R   RJ   t   infRO   R\   R_   RN   t   from_extents(	   R   Ri   Rj   Rk   Rl   R   RL   t   xst   ys(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   union  s     			

 N(   g      ?g      ?(   i    i    (   g      ?i    (   g      ?i    (   g      ?g      ?(   g      ?g      ?(   g      ?g      ?(   i    g      ?(   i    g      ?(N   R,   R>   R?   R   RC   R   RE   RM   t   staticmethodR"   R   RR   RU   RV   t   propertyR   Ri   RW   Rj   RX   Rk   RY   Rl   RZ   t   p0R[   t   p1R]   t   xminR^   t   yminR`   t   xmaxRa   t   ymaxRb   R\   Rc   R_   Rd   Ro   Re   Rr   Rf   R   Rg   R   Rh   R   Rm   R   Rn   t   extentsRO   Rq   Rt   Ru   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRF      s   
																																												
	
			
	
				

!									
		RN   c           B   s5  e  Z d  Z d   Z e o e Z d   Z d   Z n e i d d g d d g g e i	  Z
 d   Z e e  Z d   Z e e  Z d   Z e e  Z d	   Z e Z d
   Z d d  Z d e e d  Z d e e d  Z d   Z e e i e  Z d   Z e e i e  Z d   Z e e i  e  Z! d   Z" e e i# e"  Z$ d   Z% e e i& e%  Z' d   Z( e e i) e(  Z* d   Z+ e e i, e+  Z- d   Z. e e i/ e.  Z0 d   Z1 e e i2 e1  Z3 d   Z4 e e4  Z5 d   Z6 e e6  Z7 d   Z8 e e8  Z9 d   Z: d   Z; d   Z< RS(   s!   
    A mutable bounding box.
    c         C   sJ   t  i |   t i | t i  |  _ t i d d g  |  _ t |  _	 d S(   s  
        *points*: a 2x2 numpy array of the form [[x0, y0], [x1, y1]]

        If you need to create a :class:`Bbox` object from another form
        of data, consider the static methods :meth:`unit`,
        :meth:`from_bounds` and :meth:`from_extents`.
        gHz>N(
   RF   R   RJ   RK   t   float_R   R   t   _minposR   t   _ignore(   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  |  |  i |  d  S(   N(   RM   t	   ___init__(   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s!   |  i  |  i  t i |   d  S(   N(   RM   R   R   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    g        g      ?c           C   s   t  t  i i    S(   s_   
        (staticmethod) Create a new unit :class:`Bbox` from (0, 0) to
        (1, 1).
        (   RN   t   _unit_valuesRP   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   t  i |  | |  | | |  S(   s   
        (staticmethod) Create a new :class:`Bbox` from *x0*, *y0*,
        *width* and *height*.

        *width* and *height* may be negative.
        (   RN   R   (   Ri   Rj   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   from_bounds  s    c          G   s.   t  i |  d t  i i d d  } t |  S(   s   
        (staticmethod) Create a new Bbox from *left*, *bottom*,
        *right* and *top*.

        The *y*-axis increases upwards.
        t   dtypei   (   RJ   R   R   t   reshapeRN   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    $c         C   s   d t  |  i  S(   Ns   Bbox(%s)(   t   reprR   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __repr__  s    c         C   s   | |  _  d S(   s  
        Set whether the existing bounds of the box should be ignored
        by subsequent calls to :meth:`update_from_data` or
        :meth:`update_from_data_xy`.

        *value*:

           - When True, subsequent calls to :meth:`update_from_data`
             will ignore the existing bounds of the :class:`Bbox`.

           - When False, subsequent calls to :meth:`update_from_data`
             will include the existing bounds of the :class:`Bbox`.
        N(   R   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s\   t  i d  t i | i t |  d f  | i t |  d f  f  } |  i | |  S(   s  
        Update the bounds of the :class:`Bbox` based on the passed in
        data.  After updating, the bounds will have positive *width*
        and *height*; *x0* and *y0* will be the minimal values.

        *x*: a numpy array of *x*-values

        *y*: a numpy array of *y*-values

        *ignore*:
           - when True, ignore the existing bounds of the :class:`Bbox`.
           - when False, include the existing bounds of the :class:`Bbox`.
           - when None, use the last value passed to :meth:`ignore`.
        sR   update_from_data requires a memory copy -- please replace with update_from_data_xyi   (   RH   RI   RJ   t   hstackR   R   R   (   R   Rp   Rs   R   t   xy(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   update_from_data  s    ?c         C   s   | d j o |  i } n | i i d j o d St | d |  i |  i |  \ } } } | o |  i   | o> | d d  d f |  i d d  d f <| d |  i d <n | o> | d d  d f |  i d d  d f <| d |  i d <q n d S(   sa  
        Update the bounds of the :class:`Bbox` based on the passed in
        data.  After updating, the bounds will have positive *width*
        and *height*; *x0* and *y0* will be the minimal values.

        *path*: a :class:`~matplotlib.path.Path` instance

        *ignore*:
           - when True, ignore the existing bounds of the :class:`Bbox`.
           - when False, include the existing bounds of the :class:`Bbox`.
           - when None, use the last value passed to :meth:`ignore`.

        *updatex*: when True, update the x values

        *updatey*: when True, update the y values
        i    Ni   (   R   R   R   R   R   R   R   R   (   R   t   pathR   t   updatext   updateyRL   t   minpost   changed(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   update_from_path  s    $
))c         C   sG   t  |  d j o d St |  } |  i | d | d | d | d S(   sP  
        Update the bounds of the :class:`Bbox` based on the passed in
        data.  After updating, the bounds will have positive *width*
        and *height*; *x0* and *y0* will be the minimal values.

        *xy*: a numpy array of 2D points

        *ignore*:
           - when True, ignore the existing bounds of the :class:`Bbox`.
           - when False, include the existing bounds of the :class:`Bbox`.
           - when None, use the last value passed to :meth:`ignore`.

        *updatex*: when True, update the x values

        *updatey*: when True, update the y values
        i    NR   R   R   (   R   R   R   (   R   R   R   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   C  s
    c         C   s   | |  i  d <|  i   d  S(   Ni    (   i    i    (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_x0[  s    c         C   s   | |  i  d <|  i   d  S(   Ni    i   (   i    i   (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_y0`  s    c         C   s   | |  i  d <|  i   d  S(   Ni   i    (   i   i    (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_x1e  s    c         C   s   | |  i  d <|  i   d  S(   Ni   (   i   i   (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_y1j  s    c         C   s   | |  i  d <|  i   d  S(   Ni    (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_p0o  s    c         C   s   | |  i  d <|  i   d  S(   Ni   (   R   R   (   R   R6   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_p1t  s    c         C   s'   | |  i  d  d   d f <|  i   d  S(   Ni    (   R   R   (   R   t   interval(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_intervalxy  s    c         C   s'   | |  i  d  d   d f <|  i   d  S(   Ni   (   R   R   (   R   R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_intervaly~  s    c         C   su   | \ } } } } t  i | | g | | | | g g t  i  } t  i |  i | j  o | |  _ |  i   n d  S(   N(   RJ   R   R   t   anyR   R   (   R   R   R   R   R   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _set_bounds  s
    /	c         C   s   |  i  S(   N(   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_minpos  s    c         C   s   |  i  d S(   Ni    (   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_minposx  s    c         C   s   |  i  d S(   Ni   (   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_minposy  s    c         C   s   d |  _  |  i S(   sy   
        Get the points of the bounding box directly as a numpy array
        of the form: [[x0, y0], [x1, y1]].
        i    (   R
   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRO     s    	c         C   s4   t  i |  i | j  o | |  _ |  i   n d S(   s   
        Set the points of the bounding box directly from a numpy array
        of the form: [[x0, y0], [x1, y1]].  No error checking is
        performed, as this method is mainly for internal use.
        N(   RJ   R  R   R   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   set_points  s    	c         C   s@   t  i |  i | i   j  o | i   |  _ |  i   n d S(   sb   
        Set this bounding box from the "frozen" bounds of another
        :class:`Bbox`.
        N(   RJ   R  R   RO   R   (   R   Rv   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<     s    N(=   R,   R>   R?   R   RE   R   R   RJ   R   R   R   R   R   R   R   R   t   __str__R   R   R   R   R   R   R   R   RF   RV   Ri   R   RW   Rj   R   RX   Rk   R   RY   Rl   R   RZ   R   R  R[   R   R  Rd   Ro   R  Re   Rr   R  Rm   R   R  R   R  t   minposxR	  t   minposyRO   R
  R<   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRN     s\   		'						$														
t   TransformedBboxc           B   sX   e  Z d  Z d   Z d   Z e Z d   Z e i i e _ e o e Z	 d   Z n RS(   s   
    A :class:`Bbox` that is automatically transformed by a given
    transform.  When either the child bounding box or transform
    changes, the bounds of this bbox will update accordingly.
    c         C   s<   t  i |   | |  _ | |  _ |  i | |  d |  _ d S(   s]   
        *bbox*: a child :class:`Bbox`

        *transform*: a 2D :class:`Transform`
        N(   RF   R   t   _bboxt
   _transformR   R   R   (   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s
    		c         C   s   d |  i  |  i f S(   Ns   TransformedBbox(%s, %s)(   R  R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   sW   |  i  oF |  i i |  i i    } t i i | d  } | |  _ d |  _  n |  i S(   Ng        i    (	   R
   R  R   R  RO   RJ   R    t   filledR   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRO     s    
	c         C   s   |  i    } |  i |  | S(   N(   t   _get_pointsRM   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRO     s    (
   R,   R>   R?   R   R   R  RO   RN   RE   R  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s   			t	   Transformc           B   s   e  Z d  Z d Z d Z e Z e Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z e d d  Z d   Z RS(   s  
    The base class of all :class:`TransformNode` instances that
    actually perform a transformation.

    All non-affine transformations should be subclasses of this class.
    New affine transformations should be subclasses of
    :class:`Affine2D`.

    Subclasses of this class should override the following members (at
    minimum):

      - :attr:`input_dims`
      - :attr:`output_dims`
      - :meth:`transform`
      - :attr:`is_separable`
      - :attr:`has_inverse`
      - :meth:`inverted` (if :meth:`has_inverse` can return True)

    If the transform needs to do something non-standard with
    :class:`mathplotlib.path.Path` objects, such as adding curves
    where there were once line segments, it should override:

      - :meth:`transform_path`
    c         C   s8   t  | t  o t |  |  St d t |    d S(   sc   
        Composes two transforms together such that *self* is followed
        by *other*.
        s,   Can not add Transform to object of type '%s'N(   R   R  t   composite_transform_factoryt	   TypeErrort   type(   R   Rv   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __add__  s    c         C   s8   t  | t  o t | |   St d t |    d S(   sc   
        Composes two transforms together such that *self* is followed
        by *other*.
        s,   Can not add Transform to object of type '%s'N(   R   R  R  R  R  (   R   Rv   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __radd__  s    c         O   s   |  i    i   S(   sP   
        Used by C/C++ -based backends to get at the array matrix data.
        (   R"   RR   (   R   R   RQ   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRR     s    c         C   s   t     d S(   s   
        Performs the transformation on the given array of values.

        Accepts a numpy array of shape (N x :attr:`input_dims`) and
        returns a numpy array of shape (N x :attr:`output_dims`).
        N(   R   (   R   t   values(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   !  s    c         C   s   | S(   s  
        Performs only the affine part of this transformation on the
        given array of values.

        ``transform(values)`` is always equivalent to
        ``transform_affine(transform_non_affine(values))``.

        In non-affine transformations, this is generally a no-op.  In
        affine transformations, this is equivalent to
        ``transform(values)``.

        Accepts a numpy array of shape (N x :attr:`input_dims`) and
        returns a numpy array of shape (N x :attr:`output_dims`).
        (    (   R   R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_affine*  s    c         C   s   |  i  |  S(   s  
        Performs only the non-affine part of the transformation.

        ``transform(values)`` is always equivalent to
        ``transform_affine(transform_non_affine(values))``.

        In non-affine transformations, this is generally equivalent to
        ``transform(values)``.  In affine transformations, this is
        always a no-op.

        Accepts a numpy array of shape (N x :attr:`input_dims`) and
        returns a numpy array of shape (N x :attr:`output_dims`).
        (   R   (   R   R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_non_affine;  s    c         C   s   t    S(   s8   
        Get the affine part of this transform.
        (   t   IdentityTransform(   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   get_affineK  s    c         C   s   |  i  t i | g   d S(   s  
        A convenience function that returns the transformed copy of a
        single point.

        The point is given as a sequence of length :attr:`input_dims`.
        The transformed point is returned as a sequence of length
        :attr:`output_dims`.
        i    (   R   RJ   RK   (   R   t   point(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_pointQ  s    
c         C   s   t  |  i | i  | i  S(   s   
        Returns a transformed copy of path.

        *path*: a :class:`~matplotlib.path.Path` instance.

        In some cases, this transform may insert curves into the path
        that began as line segments.
        (   R   R   R   t   codes(   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_path]  s    	c         C   s   | S(   s  
        Returns a copy of path, transformed only by the affine part of
        this transform.

        *path*: a :class:`~matplotlib.path.Path` instance.

        ``transform_path(path)`` is equivalent to
        ``transform_path_affine(transform_path_non_affine(values))``.
        (    (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_path_affineh  s    
c         C   s   t  |  i | i  | i  S(   s!  
        Returns a copy of path, transformed only by the non-affine
        part of this transform.

        *path*: a :class:`~matplotlib.path.Path` instance.

        ``transform_path(path)`` is equivalent to
        ``transform_path_affine(transform_path_non_affine(values))``.
        (   R   R  R   R   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_path_non_affinet  s    
gh㈵>c   
      C   s   |  i  d j p |  i d j o t d   n | p | d t i } n | | t i t i |  t i |  f } |  i |  } |  i |  } | | } t i	 | d d  d f | d d  d f  }	 | p |	 d t i }	 n |	 S(   s  
        Performs transformation on a set of angles anchored at
        specific locations.

        The *angles* must be a column vector (i.e., numpy array).

        The *pts* must be a two-column numpy array of x,y positions
        (angle transforms currently only work in 2D).  This array must
        have the same number of rows as *angles*.

        *radians* indicates whether or not input angles are given in
         radians (True) or degrees (False; the default).

        *pushoff* is the distance to move away from *pts* for
         determining transformed angles (see discussion of method
         below).

        The transformed angles are returned in an array with the same
        size as *angles*.

        The generic version of this method uses a very generic
        algorithm that transforms *pts*, as well as locations very
        close to *pts*, to find the angle in the transformed system.
        i   s   Only defined in 2Dg     f@Ni   i    (
   t
   input_dimst   output_dimsR   RJ   t   pit   c_t   cost   sinR   t   arctan2(
   R   t   anglest   ptsR   t   pushofft   pts2t   tptst   tpts2t   dR   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   transform_angles  s     
-
2c         C   s   t     d S(   s,  
        Return the corresponding inverse transformation.

        The return value of this method should be treated as
        temporary.  An update to *self* does not cause a corresponding
        update to its inverted copy.

        ``x === self.inverted().transform(self.transform(x))``
        N(   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    
N(   R,   R>   R?   R   R$  R%  RB   t   has_inverset   is_separableR  R  RR   R   R  R  R  R  R!  R"  R#  R2  R   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s$   	
	
										9t   TransformWrapperc           B   s   e  Z d  Z e Z e Z d   Z d   Z e Z	 d   Z
 e i
 i e
 _ d   Z d   Z d   Z e e  Z d   Z e e  Z RS(   s  
    A helper class that holds a single child transform and acts
    equivalently to it.

    This is useful if a node of the transform tree must be replaced at
    run time with a transform of a different type.  This class allows
    that replacement to correctly trigger invalidation.

    Note that :class:`TransformWrapper` instances must have the same
    input and output dimensions during their entire lifetime, so the
    child transform may only be replaced with another child transform
    of the same dimensions.
    c         C   s?   t  i |   | i |  _ | i |  _ |  i |  d |  _ d S(   st   
        *child*: A class:`Transform` instance.  This child may later
        be replaced with :meth:`set`.
        i    N(   R  R   R$  R%  t   _setR
   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s
    c         C   s   d |  i  S(   Ns   TransformWrapper(%r)(   t   _child(   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  i   S(   N(   R7  R"   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"     s    c         C   sz   | |  _  |  i |  | i |  _ | i |  _ | i |  _ | i |  _ | i |  _ | i |  _ | i |  _ | i	 |  _	 d  S(   N(
   R7  R   R   R  R  R!  R"  R#  R  R   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR6    s    	c         C   s-   |  i  |  d |  _ |  i   d |  _ d S(   s   
        Replace the current child of this transform with another one.

        The new child must have the same number of input and output
        dimensions as the current child.
        i    N(   R6  R
   R   (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<     s    
	
c         C   s
   |  i  i S(   N(   R7  R4  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_is_separable	  s    c         C   s
   |  i  i S(   N(   R7  R3  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_has_inverse  s    (   R,   R>   R?   R   R   RB   R   R   R   R  R"   R  R6  R<   R8  R   R4  R9  R3  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR5    s   							t
   AffineBasec           B   s   e  Z d  Z e Z d   Z d   Z d   Z e e  Z d   Z	 d   Z
 e i
 i e
 _ d   Z e i i e _ d   Z e i i e _ d   Z e i i e _ RS(	   sW   
    The base class of all affine transformations of any number of
    dimensions.
    c         C   s   t  i |   d  |  _ d  S(   N(   R  R   R   t	   _inverted(   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         O   s
   |  i    S(   N(   t
   get_matrix(   R   R   RQ   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRR     s    c         C   s   t  i | |   S(   sj   
        Concatenates two transformation matrices (represented as numpy
        arrays) together.
        (   RJ   t   dot(   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _concat!  s    c         C   s   t     d S(   sL   
        Get the underlying transformation matrix as a numpy array.
        N(   R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<  )  s    c         C   s   | S(   N(    (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  /  s    c         C   s   |  i  |  S(   N(   R!  (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"  3  s    c         C   s   | S(   N(    (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR#  7  s    c         C   s   |  S(   N(    (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  ;  s    (   R,   R>   R?   R   R   R   RR   R>  R   R<  R  R  R"  R#  R  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR:    s   								t   Affine2DBasec           B   s   e  Z d  Z d Z d Z d   Z e i i e _ d   Z e e  Z	 d   Z
 d   Z d   Z e e  Z d   Z d   Z e i i e _ e o e Z d	   Z n e i i e _ e Z e i i e _ d
   Z e i i e _ RS(   s  
    The base class of all 2D affine transformations.

    2D affine transformations are performed using a 3x3 numpy array::

        a c e
        b d f
        0 0 1

    This class provides the read-only interface.  For a mutable 2D
    affine transformation, use :class:`Affine2D`.

    Subclasses of this class will generally only need to override a
    constructor and :meth:`get_matrix` that generates a custom 3x3 matrix.
    i   c         C   s   t  |  i   i    S(   N(   R   R<  RP   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"   Y  s    c         C   s+   |  i    } | d d j o | d d j S(   Ni    i   g        (   i    i   (   i   i    (   R<  (   R   t   mtx(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR8  ]  s    c         O   s
   |  i    S(   N(   R<  (   R   R   RQ   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRR   b  s    c         C   s,   |  i    } t | d  i d d  i    S(   sM   
        Return the values of the matrix as a sequence (a,b,c,d,e,f)
        i   i    i   (   R<  t   tuplet   swapaxesRT   (   R   R@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt	   to_valuese  s    c         C   s7   t  i |  | | g | | | g d d d g g t  i  S(   s   
        (staticmethod) Create a new transformation matrix as a 3x3
        numpy array of the form::

          a c e
          b d f
          0 0 1
        g        g      ?(   RJ   R   R   (   R   R   R   R1  t   et   f(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   matrix_from_valuesm  s    	c         C   sX   |  i    } t | t  o/ t | i |  } t i | d t i |  St | |  S(   Nt   mask(   R<  R   t   MaskedArrayR   t   dataR    t   getmask(   R   RL   R@  t   tpoints(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   y  s
    c         C   s   |  i    } t | |  S(   N(   R<  R   (   R   R  R@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    c         C   sQ   t  i |  o3 t | t i  o t i d d t t   n |  i	 |  S(   Ns/   A non-numpy array of type %s was passed in for s%   transformation.  Please correct this.(
   R    RG   R   RJ   t   ndarrayRH   RI   R  R  R  (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   sO   |  i  d  j p
 |  i o. |  i   } t t |   |  _  d |  _ n |  i  S(   Ni    (   R;  R   R
   R<  R   R   (   R   R@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s
    (   R,   R>   R?   R$  R%  R"   R:  R8  R   R4  RR   RC  RF  R   R   R  RE   R  R  R   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR?  @  s,   					
			R   c           B   s   e  Z d  Z d d  Z d   Z e Z d   Z d   Z e	 e  Z d   Z
 d   Z d   Z d   Z e	 e  Z d	   Z d
   Z d   Z d   Z d   Z d   Z d d  Z d   Z e e  Z RS(   s-   
    A mutable 2D affine transformation.
    c         C   sc   t  i |   | d j o t i d  } n! t o t i | t i  } n | |  _ d |  _	 d S(   s   
        Initialize an Affine transform from a 3x3 numpy float array::

          a c e
          b d f
          0 0 1

        If *matrix* is None, initialize with the identity transform.
        i   i    N(
   R?  R   R   RJ   t   identityRE   RK   R   t   _mtxR
   (   R   t   matrix(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    
	c         C   s   d t  |  i  S(   Ns   Affine2D(%s)(   R   RN  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s8   t  | t  o$ |  i   | i   j i   o d Sd S(   Ni    i(   R   R   R<  t   all(   R   Rv   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   __cmp__  s    c         C   s=   t  t i |  | | | | | d d d g	 t i  i d   S(   s   
        (staticmethod) Create a new Affine2D instance from the given
        values::

          a c e
          b d f
          0 0 1
        g        g      ?i   (   i   i   (   R   RJ   R   R   R   (   R   R   R   R1  RD  RE  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   from_values  s    	0c         C   s   d |  _  |  i S(   s   
        Get the underlying transformation matrix as a 3x3 numpy array::

          a c e
          b d f
          0 0 1
        i    (   R
   RN  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<    s    	c         C   s   | |  _  |  i   d S(   s   
        Set the underlying transformation matrix from a 3x3 numpy array::

          a c e
          b d f
          0 0 1
        N(   RN  R   (   R   R@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   set_matrix  s    	c         C   s   | i    |  _ |  i   d S(   so   
        Set this transformation from the frozen copy of another
        :class:`Affine2DBase` object.
        N(   R<  RN  R   (   R   Rv   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<     s    c           C   s   t  t i d   S(   s   
        (staticmethod) Return a new :class:`Affine2D` object that is
        the identity transform.

        Unless this transform will be mutated later on, consider using
        the faster :class:`IdentityTransform` class instead.
        i   (   R   RJ   RM  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRM    s    c         C   s    t  i d  |  _ |  i   |  S(   sH   
        Reset the underlying matrix to the identity transform.
        i   (   RJ   RM  RN  R   (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   clear  s    
c         C   s~   t  i |  } t  i |  } t  i | | d g | | d g d d d g g t  i  } t  i | |  i  |  _ |  i   |  S(   s   
        Add a rotation (in radians) to this transform in place.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        g        g      ?(   RJ   R(  R)  R   R   R=  RN  R   (   R   t   thetaR   R   t
   rotate_mtx(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    (
c         C   s   |  i  | t i d  S(   s   
        Add a rotation (in degrees) to this transform in place.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        g     f@(   R   RJ   R&  (   R   t   degrees(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt
   rotate_deg  s    c         C   s'   |  i  | |  i |  i  | |  S(   s   
        Add a rotation (in radians) around the point (x, y) in place.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        (   t	   translateR   (   R   Rp   Rs   RU  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   rotate_around  s    c         C   s'   |  i  | |  i |  i  | |  S(   s   
        Add a rotation (in degrees) around the point (x, y) in place.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        (   RY  RX  (   R   Rp   Rs   RW  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   rotate_deg_around)  s    c         C   s_   t  i d d | g d d | g d d d g g t  i  } t  i | |  i  |  _ |  i   |  S(   s   
        Adds a translation in place.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        g      ?g        (   RJ   R   R   R=  RN  R   (   R   R   R   t   translate_mtx(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRY  3  s    '
c         C   sv   | d j o
 | } n t i | d d g d | d g d d d g g t i  } t i | |  i  |  _ |  i   |  S(   s3  
        Adds a scale in place.

        If *sy* is None, the same scale is applied in both the *x*- and
        *y*-directions.

        Returns *self*, so this method can easily be chained with more
        calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
        and :meth:`scale`.
        g        g      ?N(   R   RJ   R   R   R=  RN  R   (   R   t   sxt   syt	   scale_mtx(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   scaleB  s    
'
c         C   s+   |  i    } | d d j o | d d j S(   Ni    i   g        (   i    i   (   i   i    (   R<  (   R   R@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR8  V  s    N(   R,   R>   R?   R   R   R   R  RQ  RR  R   R<  RS  R<   RM  RT  R   RX  RZ  R[  RY  R`  R8  R   R4  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s*   						
					
	
	
		R  c           B   s  e  Z d  Z e i d  Z d   Z e i i e _ d   Z e Z	 d   Z
 e i
 i e
 _ d   Z e i i e _ e Z e i i e _ e Z e i i e _ d   Z e i i e _ e Z e i i e _ e Z e i i e _ d   Z e i i e _ e Z e i i e _ RS(   sX   
    A special class that does on thing, the identity transform, in a
    fast way.
    i   c         C   s   |  S(   N(    (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"   c  s    c         C   s   d S(   Ns   IdentityTransform()(    (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   g  s    c         C   s   |  i  S(   N(   RN  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<  k  s    c         C   s   | S(   N(    (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   o  s    c         C   s   | S(   N(    (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR!  y  s    c         C   s   |  S(   N(    (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    (   R,   R>   R?   RJ   RM  RN  R"   R?  R   R  R<  R   R  R  R!  R"  R#  R  R   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  \  s0   						t   BlendedGenericTransformc           B   s   e  Z d  Z d Z d Z e Z e Z d   Z d   Z	 e
 e	  Z d   Z e i i e _ d   Z e Z d   Z e i i e _ d   Z e i i e _ d   Z e i i e _ d	   Z e i i e _ d
   Z e i i e _ RS(   s   
    A "blended" transform uses one transform for the *x*-direction, and
    another transform for the *y*-direction.

    This "generic" version can handle any given child transform in the
    *x*- and *y*-directions.
    i   c         C   s<   t  i |   | |  _ | |  _ |  i | |  d |  _ d S(   s  
        Create a new "blended" transform using *x_transform* to
        transform the *x*-axis and *y_transform* to transform the
        *y*-axis.

        You will generally not call this constructor directly but use
        the :func:`blended_transform_factory` function instead, which
        can determine automatically which kind of blended transform to
        create.
        N(   R  R   t   _xt   _yR   R   t   _affine(   R   t   x_transformt   y_transform(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s
    		c         C   s   |  i  i o
 |  i i S(   N(   Rb  R   Rc  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _get_is_affine  s    c         C   s   t  |  i i   |  i i    S(   N(   t   blended_transform_factoryRb  R"   Rc  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"     s    c         C   s   d |  i  |  i f S(   Ns   BlendedGenericTransform(%s,%s)(   Rb  Rc  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   st  |  i  } |  i } | | j o | i d j o | i |  S| i d j o) | i |  d  d   d d  f } n; | i | d  d   d f  } | i t |  d f  } | i d j o) | i |  d  d   d d   f } n; | i | d  d   d f  } | i t |  d f  } t | t  p t | t  o t i	 | | f d  St
 i	 | | f d  Sd  S(   Ni   i    i   (   Rb  Rc  R$  R   R   R   R   RH  R    t   concatenateRJ   (   R   RL   Rp   Rs   t   x_pointst   y_points(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    		)) c         C   s   |  i    i |  S(   N(   R  R   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    c         C   s,   |  i  i o |  i i o | S|  i |  S(   N(   Rb  R   Rc  R   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    c         C   s   t  |  i i   |  i i    S(   N(   Ra  Rb  R   Rc  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  p |  i d  j o |  i i o |  i i o |  i |  i j o |  i i   |  _ q |  i i   i   } |  i i   i   } t i	 | d | d d d d g f  } t
 |  |  _ n t   |  _ d |  _  n |  i S(   Ni    i   g        g      ?(   R
   Rd  R   Rb  R   Rc  R  R<  RJ   t   vstackR   R  (   R   t   x_mtxt   y_mtxR@  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    )(   R,   R>   R?   R$  R%  R   R4  R   R   Rg  R   R   R"   R  R   R  R   R  R  R   R  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRa    s,   									t   BlendedAffine2Dc           B   sD   e  Z d  Z e Z d   Z d   Z e Z d   Z e	 i i e _ RS(   s   
    A "blended" transform uses one transform for the *x*-direction, and
    another transform for the *y*-direction.

    This version is an optimization for the case where both child
    transforms are of type :class:`Affine2DBase`.
    c         C   sI   t  i |   | |  _ | |  _ |  i | |  t i |   d |  _ d S(   s  
        Create a new "blended" transform using *x_transform* to
        transform the *x*-axis and *y_transform* to transform the
        *y*-axis.

        Both *x_transform* and *y_transform* must be 2D affine
        transforms.

        You will generally not call this constructor directly but use
        the :func:`blended_transform_factory` function instead, which
        can determine automatically which kind of blended transform to
        create.
        N(   R  R   Rb  Rc  R   R?  R   RN  (   R   Re  Rf  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    		c         C   s   d |  i  |  i f S(   Ns   BlendedAffine2D(%s,%s)(   Rb  Rc  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  o |  i |  i j o |  i i   |  _ nK |  i i   } |  i i   } t i | d | d d d d g f  |  _ d  |  _ d |  _  n |  i S(   Ni    i   g        g      ?(	   R
   Rb  Rc  R<  RN  RJ   Rl  R   R;  (   R   Rm  Rn  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<    s    
,	(
   R,   R>   R?   R   R4  R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRo    s   			c         C   s;   t  |  t  o t  | t  o t |  |  St |  |  S(   s   
    Create a new "blended" transform using *x_transform* to transform
    the *x*-axis and *y_transform* to transform the *y*-axis.

    A faster version of the blended transform is returned for the case
    where both child transforms are affine.
    (   R   R?  Ro  Ra  (   Re  Rf  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRh  ,  s    t   CompositeGenericTransformc           B   s.  e  Z d  Z e Z d   Z d   Z e i i e _ d   Z e	 e  Z
 d   Z e	 e  Z d   Z e Z d   Z e i i e _ d   Z e i i e _ d   Z e i i e _ d	   Z e i i e _ d
   Z e i i e _ d   Z e i i e _ d   Z e i i e _ d   Z e i i e _ RS(   s   
    A composite transform formed by applying transform *a* then
    transform *b*.

    This "generic" version can handle any two arbitrary
    transformations.
    c         C   sK   | i  |  _  | i |  _ t i |   | |  _ | |  _ |  i | |  d S(   sl  
        Create a new composite transform that is the result of
        applying transform *a* then transform *b*.

        You will generally not call this constructor directly but use
        the :func:`composite_transform_factory` function instead,
        which can automatically choose the best kind of composite
        transform instance to create.
        N(   R$  R%  R  R   t   _at   _bR   (   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   D  s    		c         C   sI   d |  _  t |  i i   |  i i    } t | t  p | i   S| S(   Ni    (   R
   R  Rq  R"   Rr  R   Rp  (   R   R"   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"   W  s
    	!c         C   s   |  i  i o
 |  i i S(   N(   Rq  R   Rr  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRg  _  s    c         C   s   |  i  i o
 |  i i S(   N(   Rq  R4  Rr  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR8  c  s    c         C   s   d |  i  |  i f S(   Ns!   CompositeGenericTransform(%s, %s)(   Rq  Rr  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   g  s    c         C   s   |  i  i |  i i |   S(   N(   Rr  R   Rq  (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   k  s    	c         C   s   |  i    i |  S(   N(   R  R   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  p  s    c         C   s;   |  i  i o |  i i o | S|  i i |  i  i |   S(   N(   Rq  R   Rr  R  R   (   R   RL   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  t  s    	c         C   s   |  i  i |  i i |   S(   N(   Rr  R!  Rq  (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR!  {  s    	c         C   s   |  i  i |  i i |   S(   N(   Rr  R"  Rq  R!  (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR"    s    	c         C   s;   |  i  i o |  i i o | S|  i i |  i  i |   S(   N(   Rq  R   Rr  R#  R!  (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR#    s    	c         C   s`   |  i  i oB |  i i o5 t t i |  i i   i   |  i  i   i     S|  i i   Sd  S(   N(   Rq  R   Rr  R   RJ   R=  R  R<  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    c         C   s   t  |  i i   |  i i    S(   N(   Rp  Rr  R   Rq  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    (   R,   R>   R?   R   R   R   R"   R  Rg  R   R   R8  R4  R   R  R   R  R  R!  R"  R#  R  R   (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRp  :  s6   													t   CompositeAffine2Dc           B   s>   e  Z d  Z d   Z d   Z e Z d   Z e i i e _ RS(   s   
    A composite transform formed by applying transform *a* then transform *b*.

    This version is an optimization that handles the case where both *a*
    and *b* are 2D affines.
    c         C   sT   | i  |  _  | i |  _ t i |   | |  _ | |  _ |  i | |  d |  _ d S(   s  
        Create a new composite transform that is the result of
        applying transform *a* then transform *b*.

        Both *a* and *b* must be instances of :class:`Affine2DBase`.

        You will generally not call this constructor directly but use
        the :func:`composite_transform_factory` function instead,
        which can automatically choose the best kind of composite
        transform instance to create.
        N(	   R$  R%  R?  R   Rq  Rr  R   R   RN  (   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    		c         C   s   d |  i  |  i f S(   Ns   CompositeAffine2D(%s, %s)(   Rq  Rr  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   sN   |  i  o= t i |  i i   |  i i    |  _ d  |  _ d |  _  n |  i S(   Ni    (	   R
   RJ   R=  Rr  R<  Rq  RN  R   R;  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<    s    
	(   R,   R>   R?   R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRs    s   			c         C   se   t  |  t  o | St  | t  o |  St  |  t  o t  | t  o t |  |  St |  |  S(   sv  
    Create a new composite transform that is the result of applying
    transform a then transform b.

    Shortcut versions of the blended transform are provided for the
    case where both child transforms are affine, or one or the other
    is the identity transform.

    Composite transforms may also be created using the '+' operator,
    e.g.::

      c = a + b
    (   R   R  R:  Rs  Rp  (   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s     t   BboxTransformc           B   sD   e  Z d  Z e Z d   Z d   Z e Z d   Z e	 i i e _ RS(   sp   
    :class:`BboxTransform` linearly transforms points from one
    :class:`Bbox` to another :class:`Bbox`.
    c         C   sE   t  i |   | |  _ | |  _ |  i | |  d |  _ d |  _ d S(   sw   
        Create a new :class:`BboxTransform` that linearly transforms
        points from *boxin* to *boxout*.
        N(   R?  R   t   _boxint   _boxoutR   R   RN  R;  (   R   t   boxint   boxout(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    			c         C   s   d |  i  |  i f S(   Ns   BboxTransform(%s, %s)(   Ru  Rv  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  o |  i i \ } } } } |  i i \ } } } } | | }	 | | }
 t o* |	 d j p |
 d j o t d   n t i |	 d | |	 | g d |
 | |
 | g d d d g g t i  |  _	 d  |  _ d |  _  n |  i	 S(   Ni    s0   Transforming from or to a singular bounding box.g        g      ?(   R
   Ru  R   Rv  RE   t
   ValueErrorRJ   R   R   RN  R   R;  (   R   t   inlt   inbt   inwt   inht   outlt   outbt   outwt   outht   x_scalet   y_scale(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<    s    


!	(
   R,   R>   R?   R   R4  R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyRt    s   			t   BboxTransformToc           B   sD   e  Z d  Z e Z d   Z d   Z e Z d   Z e	 i i e _ RS(   s   
    :class:`BboxTransformTo` is a transformation that linearly
    transforms points from the unit bounding box to a given
    :class:`Bbox`.
    c         C   s9   t  i |   | |  _ |  i |  d |  _ d |  _ d S(   s   
        Create a new :class:`BboxTransformTo` that linearly transforms
        points from the unit bounding box to *boxout*.
        N(   R?  R   Rv  R   R   RN  R;  (   R   Rx  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s
    		c         C   s   d |  i  S(   Ns   BboxTransformTo(%s)(   Rv  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR     s    c         C   s   |  i  o |  i i \ } } } } t o* | d j p | d j o t d   n t i | d | g d | | g d d d g g t i  |  _ d  |  _
 d |  _  n |  i S(   Ni    s(   Transforming to a singular bounding box.g        g      ?(   R
   Rv  R   RE   Ry  RJ   R   R   RN  R   R;  (   R   R~  R  R  R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<  #  s    
!	(
   R,   R>   R?   R   R4  R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  
  s   			t   BboxTransformFromc           B   sD   e  Z d  Z e Z d   Z d   Z e Z d   Z e	 i i e _ RS(   sx   
    :class:`BboxTransformFrom` linearly transforms points from a given
    :class:`Bbox` to the unit bounding box.
    c         C   s9   t  i |   | |  _ |  i |  d  |  _ d  |  _ d  S(   N(   R?  R   Ru  R   R   RN  R;  (   R   Rw  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   9  s
    		c         C   s   d |  i  S(   Ns   BboxTransformFrom(%s)(   Ru  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   B  s    c         C   s   |  i  o |  i i \ } } } } t o* | d j p | d j o t d   n d | } d | } t i | d | | g d | | | g d d d g g t i  |  _ d  |  _
 d |  _  n |  i S(   Ni    s*   Transforming from a singular bounding box.g      ?g        (   R
   Ru  R   RE   Ry  RJ   R   R   RN  R   R;  (   R   Rz  R{  R|  R}  R  R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<  F  s    
!

	(
   R,   R>   R?   R   R4  R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  2  s   				t   ScaledTranslationc           B   s>   e  Z d  Z d   Z d   Z e Z d   Z e i i e _ RS(   s   
    A transformation that translates by *xt* and *yt*, after *xt* and *yt*
    have been transformad by the given transform *scale_trans*.
    c         C   sH   t  i |   | | f |  _ | |  _ |  i |  d  |  _ d  |  _ d  S(   N(   R?  R   t   _tt   _scale_transR   R   RN  R;  (   R   t   xtt   ytt   scale_trans(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   \  s    		c         C   s   d |  i  f S(   Ns   ScaledTranslation(%s)(   R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   d  s    c         C   s~   |  i  om |  i i |  i  \ } } t i d d | g d d | g d d d g g t i  |  _ d |  _  d  |  _	 n |  i S(   Ng      ?g        i    (
   R
   R  R  R  RJ   R   R   RN  R   R;  (   R   R  R  (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR<  h  s    
	(   R,   R>   R?   R   R   R  R<  R?  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  W  s   			
t   TransformedPathc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    A :class:`TransformedPath` caches a non-affine transformed copy of
    the :class:`~matplotlib.path.Path`.  This cached copy is
    automatically updated when the non-affine part of the transform
    changes.
    c         C   sB   t  i |   | |  _ | |  _ |  i |  d |  _ d |  _ d S(   s   
        Create a new :class:`TransformedPath` from the given
        :class:`~matplotlib.path.Path` and :class:`Transform`.
        N(   R   R   t   _pathR  R   R   t   _transformed_patht   _transformed_points(   R   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR   |  s    			c         C   st   |  i  |  i @|  i j p |  i d  j o= |  i i |  i  |  _ t |  i i |  i i	   |  _
 n d |  _  d  S(   Ni    (   R
   RA   R  R   R  R#  R  R   R  R   R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   _revalidate  s
    %c         C   s   |  i    |  i |  i   f S(   s3  
        Return a copy of the child path, with the non-affine part of
        the transform already applied, along with the affine part of
        the path necessary to complete the transformation.  Unlike
        :meth:`get_transformed_path_and_affine`, no interpolation will
        be performed.
        (   R  R  R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt!   get_transformed_points_and_affine  s    
c         C   s   |  i    |  i |  i   f S(   s   
        Return a copy of the child path, with the non-affine part of
        the transform already applied, along with the affine part of
        the path necessary to complete the transformation.
        (   R  R  R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   get_transformed_path_and_affine  s    
c         C   sb   |  i  |  i @|  i j p |  i d j o |  i i |  i  |  _ n d |  _  |  i i |  i  S(   sD   
        Return a fully-transformed copy of the child path.
        i    N(   R
   RA   R  R   R  R#  R  R"  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   get_fully_transformed_path  s
    	c         C   s   |  i  i   S(   N(   R  R  (   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR    s    (	   R,   R>   R?   R   R  R  R  R  R  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyR  u  s   							gMbP?gV瞯<c         C   s   t  i |   p t  i |  o | | f St } | |  j  o | |  }  } t } n | |  t t |   t |   | j oJ |  d j o | }  | } q |  | t |   8}  | | t |  7} n | o | o | |  }  } n |  | f S(   s  
    Ensure the endpoints of a range are finite and not too close together.

    "too close" means the interval is smaller than 'tiny' times
    the maximum absolute value.

    If they are too close, each will be moved by the 'expander'.
    If 'increasing' is True and vmin > vmax, they will be swapped,
    regardless of whether they are too close.

    If either is inf or -inf or nan, return - expander, expander.
    g        (   RJ   t   isfiniteRB   R   R_   R   (   t   vmint   vmaxt   expandert   tinyt
   increasingt   swapped(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   nonsingular  s    "
*
c         C   sJ   |  \ } } | | j  o | | j o | | j p | | j o
 | | j S(   N(    (   R  R6   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   interval_contains  s    'c         C   sJ   |  \ } } | | j  o | | j  o | | j p | | j  o
 | | j S(   N(    (   R  R6   R   R   (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   interval_contains_open  s    'g        t   inchesc         C   s   | d j o |  t    i | |  S| d j o t d   n | d j o | d :} | d :} n | d j p t d   n |  t | | | i  S(   s   
    Return a new transform with an added offset.
      args:
        trans is any transform
      kwargs:
        fig is the current figure; it can be None if units are 'dots'
        x, y give the offset
        units is 'inches', 'points' or 'dots'
    t   dotss3   For units of inches or points a fig kwarg is neededRL   g      R@R  s%   units must be dots, points, or inchesN(   R   RY  R   Ry  R  t   dpi_scale_trans(   t   transt   figRp   Rs   t   units(    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   offset_copy  s    

(3   R?   t   numpyRJ   R    t   matplotlib._pathR   t   numpy.linalgR   t   weakrefR   RH   R<   t	   NameErrort   setsR   t   cbookR   R   R  R   R   RB   RE   RH  t   objectR   RF   RN   R  R  R5  R:  R?  R   R  Ra  Ro  Rh  Rp  Rs  R  Rt  R  R  R  R  R   R  R  R  R  (    (    (    sE   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\transforms.pyt   <module>   sV   	 +L.`/g:	_.	,(%A		