
ZGc           @   s  d  d k  l Z l Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k i	 i
 Z d  d k Z e i Z d  d k l Z d  d k l Z d  d k l Z d  d k l Z d  d k l Z d  d k l Z d  d	 k l Z d  d
 k l Z d  d k l Z d  d k l Z d  d k l Z  d  d k l! Z" d  d k l# Z# d  d k l$ Z$ d  d k l% Z& d  d k l' Z( d  d k l) Z* d  d k l+ Z, d  d k l- Z. d  d k l/ Z0 e i1 Z1 e i2 Z2 d   Z3 d   Z4 d f  d     YZ5 e6 e0 i7    Z8 d   Z9 d e i: f d     YZ; d f  d     YZ< d  e< e; f d!     YZ= d" e; f d#     YZ> d$ e< e> f d%     YZ? e i@ e;  e iA d <e iA d  <d S(&   i(   t   divisiont
   generatorsN(   t   artist(   t   agg(   t   axis(   t   cbook(   t   collections(   t   colors(   t   contour(   t   dates(   t   font_manager(   t   image(   t   legend(   t   lines(   t   mlab(   t   cm(   t   patches(   t   quiver(   t   table(   t   text(   t   ticker(   t
   transformsc          G   s  g  } |  D]* } t  | d  o | t i |  q q ~ } t |  d j o |  Sn t t i |  } g  } x |  D] } t |  ou t |  oh t |  t |  j oO t  | d  o | i |  } n t i	 | d | i
   } | i |  qx | i |  qx W| S(   s<  
    Find all masked points in a set of arguments, and return
    the arguments with only the unmasked points remaining.

    The overall mask is calculated from any masks that are present.
    If a mask is found, any argument that does not have the same
    dimensions is left unchanged; therefore the argument list may
    include arguments that can take string or array values, for
    example.

    Array arguments must have the same length; masked arguments must
    be one-dimensional.

    Written as a helper for scatter, but may be more generally
    useful.
    t   maski    t   get_compressed_copy(   t   hasattrt   mat   getmaskarrayt   lent   reducet   mask_ort   is_string_liket   iterableR   t   masked_arrayt
   compressedt   append(   t   argst   _[1]t   xt   masksR   t   margst   compressed_x(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   delete_masked_points%   s     > c      
   C   sC  d } d } d } y# t i i |   } | | | f SWn t j
 o n X|  i d  d j o d } |  i d d  }  n |  i d  d j o d } |  i d d  }  n |  i d  d j o d } |  i d d  }  n g  } |  D] } | | q ~ } x | D] } t i i	 |  o+ | d j	 o t d |    n | } q	t i
 i	 |  o+ | d j	 o t d |    n | } q	t i i i	 |  o+ | d j	 o t d	 |    n | } q	t d
 |   q	W| d j o | d j o t d } n | d j o
 d } n | d j o
 d } n | | | f S(   s  
    Process a matlab(TM) style color/line style format string.  Return a
    linestyle, color tuple as a result of the processing.  Default
    values are ('-', 'b').  Example format strings include

    'ko'    : black circles
    '.b'    : blue dots
    'r--'   : red dashed lines

    See Line2D.lineStyles and GraphicsContext.colors for all possible
    styles and color format string.

    s   --i    t    s   -.t    t   Nones1   Illegal format string "%s"; two linestyle symbolss.   Illegal format string "%s"; two marker symbolss-   Illegal format string "%s"; two color symbolss*   Unrecognized character %c in format strings   lines.linestyleN(   R,   t   mcolorst   colorConvertert   to_rgbt
   ValueErrort   findt   replacet   mlinest
   lineStylest   has_keyt   lineMarkersR   t   rcParams(   t   fmtt	   linestylet   markert   colorR$   t   ct   chars(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _process_plot_formatH   sX    ! 




t   _process_plot_var_argsc           B   s   e  Z d  Z d d d d d d d g Z d d	  Z d
   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z RS(   s,  

    Process variable length arguments to the plot command, so that
    plot commands like the following are supported

      plot(t, s)
      plot(t1, s1, t2, s2)
      plot(t1, s1, 'ko', t2, s2)
      plot(t1, s1, 'ko', t2, s2, 'r--', t3, e3)

    an arbitrary number of x, y, fmt are allowed
    t   bt   gt   rR<   t   mt   yt   kt   plotc         C   s    | |  _  | |  _ |  i   d  S(   N(   t   axest   commandt   _clear_color_cycle(   t   selfRG   RH   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   __init__   s    		c         C   s   t  i |  _ y |  i i t d  } Wn  t j
 o t d |  _ n; X|  i | |  i d |  i d <|  i | <|  i d |  _ t |  i  |  _ d |  _	 d  S(   Ns   lines.colori    (
   R?   t   defaultColorsR   t   indexR7   R0   t
   firstColorR   t   Ncolorst   count(   RJ   t   ind(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRI      s    )c         C   sM   |  i  d j o |  i } n |  i t |  i  |  i  } |  i  d 7_  | S(   Ni    i   (   RP   RN   R   t   intRO   (   RJ   R;   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _get_next_cycle_color   s
    c         O   s   |  i  i d  j	 o |  i  i d  j	 o | i d |  i  i i  } | i d |  i  i i  } | |  i  i i j o |  i  i i |  n | |  i  i i j o |  i  i i |  q n |  i | |   } | S(   Nt   xunitst   yunits(   RG   t   xaxisR,   t   yaxist   popt   unitst	   set_unitst   _grab_next_args(   RJ   R#   t   kwargsRT   RU   t   ret(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   __call__   s    &c         K   s   |  i  d j p
 t d  x^ | i   D]P \ } } d | } t | |  p t d |  n t | |  } | |  q' Wd  S(   NRF   s$   set_lineprops only works with "plot"s   set_%ss   There is no line property "%s"(   RH   t   AssertionErrort   itemsR   t	   TypeErrort   getattr(   RJ   t   lineR\   t   keyt   valt   funcNamet   func(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_lineprops   s     
c         K   s   |  i  d j p
 t d  x^ | i   D]P \ } } d | } t | |  p t d |  n t | |  } | |  q' Wd  S(   Nt   fills%   set_patchprops only works with "fill"s   set_%ss   There is no patch property "%s"(   RH   R_   R`   R   Ra   Rb   (   RJ   t	   fill_polyR\   Rd   Re   Rf   Rg   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_patchprops   s     
c         C   s   |  i  i d  j	 o@ |  i  i i |  } | o  t i t |   | t f SqS n t i	 |  } t | i
  d j o | d  d   t i f } n | i
 \ } } t i |  } t | i
  d j o | d  d   t i f } n | | t f S(   Ni   (   RG   RW   R,   t   update_unitst   npyt   arangeR   t   FalseR   t   asarrayt   shapet   newaxist   True(   RJ   RD   R@   t   nrt   ncR%   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   _xy_from_y   s    +c   	      C   s  |  i  i d  j	 o` |  i  i d  j	 oM |  i  i i |  } |  i  i i |  } | p | o | | t f Sqs n t i |  } t i |  } t | i	  d j o | d  d   t
 i f } n t | i	  d j o | d  d   t
 i f } n | i	 \ } } | i	 \ } } | | j p
 t d  | | j o | | t f Sn | d j o t
 i | | d d } n | d j o t
 i | | d d } n | i	 | i	 j p
 t d  | | t f S(   Ni   s&   Dimensions of x and y are incompatibleR   (   RG   RV   R,   RW   Rl   Ro   R   Rp   R   Rq   Rm   Rr   R_   Rs   t   repeat(	   RJ   R%   RD   t   bxt   byt   nrxt   ncxt   nryt   ncy(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _xy_from_xy   s*    &#c   	      K   s	  |  i  d j p
 t d  g  } |  i |  \ } } } | o| x t | i d  D]` } |  i   } t i | | d  d   | f d | d |  i } |  i	 | |  | i
 |  qS WnK |  i   } t i | | d | d |  i } |  i	 | |  | i
 |  | S(   NRF   s   fill needs at least 2 argumentsi   R;   RG   (   RH   R_   Rv   t   rangeRq   RS   R3   t   Line2DRG   Rh   R"   (	   RJ   RD   R\   R]   R%   t   multicolt   jR;   t   seg(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _plot_1_arg   s&     c            s  g   t  | d  o  i d j p
 t d  | \ } }  i |  \ } } } t |  \            f d   } | oO xY t | i d  D]3 } | | d  d   | f | d  d   | f  q Wn | | |   Sn | \ } }  i | |  \ } } }    f d   }    f d   }	  i d j o
 | }
 n |	 }
 | oO xY t | i d  D]3 } |
 | d  d   | f | d  d   | f  qWn |
 | |   Sd  S(   Ni   RF   s*   fill needs at least 2 non-string argumentsc            sq     } | d  j o  i   } n t i |  | d | d  d  d  i }  i |    i |  d  S(   NR;   R9   R:   RG   (   R,   RS   R3   R   RG   Rh   R"   (   R%   RD   t   _colorR   (   R;   RJ   R]   R:   R\   R9   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   makeline$  s    c            sN     i    } t i |  | d | d   i }   i |    i |  d  S(   NR;   RG   (   RS   R3   R   RG   Rh   R"   (   R%   RD   R;   R   (   RJ   R]   R\   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   <  s    c            sQ     i    } t i t |  |  d | d t }   i |    i |  d  S(   Nt	   facecolorRi   (   RS   t   mpatchest   Polygont   zipRs   Rk   R"   (   R%   RD   R   R   (   RJ   R]   R\   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   makefillE  s    	(   R   RH   R_   Rv   R>   R   Rq   R~   (   RJ   t   tup2R\   RD   R8   R%   R   R   R   R   Rg   (    (   R;   R9   RJ   R]   R:   R\   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _plot_2_args  s2     5	
 5c            s  g   | \ } } }  i  | |  \ } } } t |  \            f d   }      f d   }  i d j o
 | }	 n | }	 | oO xY t | i d  D]3 }
 |	 | d  d   |
 f | d  d   |
 f  q Wn |	 | |   S(   Nc            sq     } | d  j o  i   } n t i |  | d | d  d  d  i }  i |    i |  d  S(   NR;   R9   R:   RG   (   R,   RS   R3   R   RG   Rh   R"   (   R%   RD   R   R   (   R;   RJ   R]   R:   R\   R9   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   b  s    c            sK     } t  i t |  |  d | d t }  i |    i |  d  S(   NR   Ri   (   R   R   R   Rs   Rk   R"   (   R%   RD   R   R   (   R;   RJ   R]   R\   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   n  s    	RF   i   (   R~   R>   RH   R   Rq   (   RJ   t   tup3R\   R%   RD   R8   R   R   R   Rg   R   (    (   R;   RJ   R]   R:   R\   R9   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _plot_3_argsZ  s    	 5c         o   s  | } x{t  |  d j o d  Sn t  |  d j o3 x# |  i | d |  D] } | VqN Wg  } q	 n t  |  d j o/ x |  i | |  D] } | Vq Wg  } q	 n t  |  d j oM t | d  p t d  n x |  i | |  D] } | Vq Wg  } q	 n t | d  o4 x# |  i | d  |  D] } | Vq4W| d } q	 x# |  i | d  |  D] } | VqhW| d } q	 d  S(   Ni    i   i   i   s!   third arg must be a format string(   R   R   R   R   R0   R   (   RJ   R#   R\   t	   remainingR   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR[     s@     	 	 	 	 	(   t   __name__t
   __module__t   __doc__RL   RK   RI   RS   R^   Rh   Rk   Rv   R~   R   R   R   R[   (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR?      s   											@	'c         C   s,   t  |   t j o |  Sn t i |   Sd  S(   N(   t   typet	   ValueTypet   mtranst   Value(   t   v(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   makeValue  s    t   Axesc           B   s-  e  Z d  Z h  d e i <d e i <Z d   Z e e	 e e d d  Z
 d   Z d   Z d   Z d	   Z d
   Z d   Z e d  Z d d  Z d   Z d   Z d   Z d   Z e d  Z d   Z e e d  Z d   Z d   Z d   Z d   Z e 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+   Z0 d,   Z1 d-   Z2 d.   Z3 d/   Z4 d0   Z5 d1   Z6 d2   Z7 e e e d3  Z8 d4   Z9 d5   Z: d6   Z; e e	 e	 d7  Z< e e d8  Z= d9   Z> d:   Z? d;   Z@ d<   ZA d=   ZB d>   ZC d?   ZD d@   ZE e dA  ZF eG iH eF i  eI iJ eF _ dB   ZK dC   ZL dD   ZM dE   ZN dF   ZO dG   ZP dH   ZQ dI   ZR e e dJ  ZS dK   ZT e e e	 dL  ZU dM   ZV dN e dO  ZW e dP  ZX e dQ  ZY dR   ZZ dS   Z[ e dT  Z\ e e dU  Z] eG iH e] i  eI iJ e] _ dV   Z^ dW   Z_ dX   Z` e e dY  Za dZ   Zb e e e	 d[  Zc d\   Zd dN e d]  Ze e d^  Zf e d_  Zg d`   Zh da   Zi e db  Zj e e dc  Zk eG iH ek i  eI iJ ek _ dd   Zl e de  Zm e df  Zn dg   Zo dh   Zp di   Zq dj   Zr dk   Zs dl   Zt dm   Zu dn   Zv do   Zw dp   Zx dq   Zy dr   Zz ds   Z{ dt   Z| e e du  Z} e dv  Z~ eG iH e~ i  eI iJ e~ _ e dw  Z eG iH e i  eI iJ e _ e dx  Z eG iH e i  eI iJ e _ e e dy  Z eG iH e i  eI iJ e _ dz   Z eG iH e i  eI iJ e _ d{ d{ d| d}  Z eG iH e i  eI iJ e _ d{ d{ d| d~  Z eG iH e i  eI iJ e _ d{ d| d  Z eG iH e i  eI iJ e _ d{ d| d  Z eG iH e i  eI iJ e _ d d d d  Z eG iH e i  e _ d d d d  Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d e e	 e d  Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ e e i e e d  Z eG iH e i  eI iJ e _ d   Z d   Z d e e e e e e e d d d e d  Z eG iH e i  eI iJ e _ d e d  Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d d d d  Z e e e e d e d d  Z e e d e d e e e e e d 
 Z eG iH e i  eI iJ e _ d{ d d| d e e d  Z d d d e e e e d e e	 e d  Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d   Z e i i e _ d   Z e i i e _ d   Z eG iH e i  eI iJ e _ e e e e d e e e e e d| d e d  Z d   Z d   Z eG iH e i  eI iJ e _ d   Z eG iH e i  eI iJ e _ d   Z d   Z e i i e _ d   Z e i i e _ d   Z e i i i e _ d   Z eG iH e i  eI iJ e _ d   Z d   Z dN d{ e d d e e d  Z eG iH e i  eI iJ e _ d d d{ e i e i d{ d  Z eG iH e i  eI iJ e _ d d d{ e i e i d{ d  Z eG iH e i  eI iJ e _ d d d{ e i e i d{ d  Z eG iH e i  eI iJ e _ d d d{ e i e i d e e d  Z e e e d d  Z d   Z RS(   s  
    The Axes contains most of the figure elements: Axis, Tick, Line2D,
    Text, Polygon etc, and sets the coordinate system

    The Axes instance supports callbacks through a callbacks attribute
    which is a cbook.CallbackRegistry instance.  The events you can
    connect to are 'xlim_changed' and 'ylim_changed' and the callback
    will be called with func(ax) where ax is the Axes instance


    t   lineart   logc         C   sH   d |  i  d i   |  i  d i   |  i  d i   |  i  d i   f S(   Ns   Axes(%g,%g;%gx%g)i    i   i   i   (   t	   _positiont   get(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   __str__  s    #R*   c   	      K   s  t  i i |   t t |  |  _ | |  _ |  i |   |  i d  |  i	 d  |  i
 d  | |  _ | |  _ t |  _ t |  _ | o t | _ n | o t | _ n |  i |  |  i |  |  i   | d
 j o t d } n | |  _ | |  _ t d |  _ t d |  _ h  |  _ |  i   d
 |  _ d
 |  _ |  i d  d
 |  _ |  i  t  |  i! d
  t" |  o t  i# |  |  n |  i$ d
 j	 o" |  i$ i% i& d	 |  i'  |  _( n |  i) d
 j	 o" |  i) i% i& d	 |  i'  |  _* n d
 S(   s  

        Build an Axes instance in Figure with
        rect=[left, bottom, width,height in Figure coords

        adjustable: ['box' | 'datalim']
        alpha: the alpha transparency
        anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
        aspect: ['auto' | 'equal' | aspect_ratio]
        autoscale_on: boolean - whether or not to autoscale the viewlim
        axis_bgcolor: any matplotlib color - see help(colors)
        axisbelow: draw the grids and ticks below the other artists
        cursor_props: a (float, color) tuple
        figure: a Figure instance
        frame_on: a boolean - draw the axes frame
        label: the axes label
        navigate: True|False
        navigate_mode: the navigation toolbar button status: 'PAN', 'ZOOM', or None
        position: [left, bottom, width,height in Figure coords
        sharex : an Axes instance to share the x-axis with
        sharey : an Axes instance to share the y-axis with
        title: the title string
        visible: a boolean - whether the axes is visible
        xlabel: the xlabel
        xlim: (xmin, xmax) view limits
        xscale: ['log' | 'linear' ]
        xticklabels: sequence of strings
        xticks: sequence of floats
        ylabel: the ylabel strings
        ylim: (ymin, ymax) view limits
        yscale: ['log' | 'linear']
        yticklabels: sequence of strings
        yticks: sequence of floats

        t   autot   boxt   Cs   axes.facecolors   axes.axisbelows	   axes.holdi   RE   s   units finalizeN(   i   RE   (+   t   martistt   ArtistRK   t   mapR   R   t   _originalPositiont   set_axest
   set_aspectt   set_adjustablet
   set_anchort   _sharext   _shareyRo   t   _masterxt   _masteryRs   t	   set_labelt
   set_figuret
   _init_axisR,   R7   t   _axisbgt   _frameont
   _axisbelowt   _holdt
   _connectedt   clat	   fmt_xdatat	   fmt_ydatat   set_cursor_propst   _cachedRenderert   set_navigatet   set_navigate_modeR   t   setpRV   t	   callbackst   connectt   relimt   _xcidRW   t   _ycid(	   RJ   t   figt   rectt   axisbgt   frameont   sharext   shareyt   labelR\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK     sD    +					
			
			!"c         O   s   |  i  S(   sE   get the axes bounding box in display space; args and kwargs are empty(   t   bbox(   RJ   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_window_extent  s    c         C   s(   t  i |   |  _ t  i |   |  _ d S(   sA   move this out of __init__ because non-separable axes don't use itN(   t   maxist   XAxisRV   t   YAxisRW   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR      s    c            sX      f d   }    f d   }  i  i d |  }   i  i d |  } | | f S(   s5  
        You can share your x-axis view limits with another Axes in the
        same Figure by using the sharex and sharey property of the
        Axes.  But this doesn't work for Axes in a different figure.
        This function sets of the callbacks so that when the xaxis of
        this Axes or the Axes in a foreign figure are changed, both
        will be synchronized.

        The connection ids for the self.callbacks and
        axforeign.callbacks cbook.CallbackRegistry instances are
        returned in case you want to disconnect the coupling
        c            s<    i    \ } }   i | | d t   i i i   d  S(   Nt   emit(   t   get_xlimt   set_xlimRo   t   figuret   canvast	   draw_idle(   t   axt   xmint   xmax(   RJ   t	   axforeign(    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   follow_foreign_xlim4  s    c            s<     i    \ } }  i | | d t  i i i   d  S(   NR   (   R   R   Ro   R   R   R   (   R   R   R   (   RJ   R   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   follow_self_xlim:  s    t   xlim_changed(   R   R   (   RJ   R   R   R   t
   cidForeignt   cidSelf(    (   RJ   R   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   sharex_foreign&  s
    c            sX      f d   }    f d   }  i  i d |  }   i  i d |  } | | f S(   s5  
        You can share your y-axis view limits with another Axes in the
        same Figure by using the sharey and sharey property of the
        Axes.  But this doesn't work for Axes in a different figure.
        This function sets of the callbacks so that when the yaxis of
        this Axes or the Axes in a foreign figure are changed, both
        will be synchronized.

        The connection ids for the self.callbacks and
        axforeign.callbacks cbook.CallbackRegistry instances are
        returned in case you want to disconnect the coupling
        c            s<    i    \ } }   i | | d t   i i i   d  S(   NR   (   t   get_ylimt   set_ylimRo   R   R   R   (   R   t   ymint   ymax(   RJ   R   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   follow_foreign_ylimT  s    c            s<     i    \ } }  i | | d t  i i i   d  S(   NR   (   R   R   Ro   R   R   R   (   R   R   R   (   RJ   R   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   follow_self_ylimZ  s    t   ylim_changed(   R   R   (   RJ   R   R   R   R   R   (    (   RJ   R   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   sharey_foreignF  s
    c         C   s  t  i i |  |  |  i \ } } } } | i i   i   } | i i   i   } | i i   i   } | i i   i   }	 | | }
 |	 | } | |
 |  _	 | | |  _
 | | |
 |  _ | | | |  _ t i } t i } | | |  i	 |  i
  | |  i |  i   |  _ |  i   d S(   sI   
        Set the Axes figure

        ACCEPTS: a Figure instance
        N(   R   R   R   R   R   t   llR%   t   urRD   t   leftt   bottomt   rightt   topR   t   Bboxt   Pointt   _set_lim_and_transforms(   RJ   R   t   lR@   t   wt   hR   R   R   R   t   figwt   fighR   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   e  s$    

		c   	      C   s  t  i } t  i } t  i } t  i } |  i d j	 o4 |  i i i   i	   } |  i i i
   i	   } n |   } |   } |  i d j	 o4 |  i i i   i   } |  i i i
   i   } n |   } |   } | | | |  | | |   |  _ t  i   |  _ t  i |  i |  i  |  _ t  i t  i   |  i  |  _ |  i o  |  i i |  i i i    n |  i o  |  i i |  i i i    n d S(   s   
        set the dataLim and viewLim BBox attributes and the
        transData and transAxes Transformation attributes
        N(   R   t   onet   zeroR   R   R   R,   t   viewLimR   R%   R   R   RD   t	   unit_bboxt   dataLimt   get_bbox_transformR   t	   transDatat	   transAxest	   set_funcxt	   get_funcxt	   set_funcyt	   get_funcy(	   RJ   R   R   R   R   R   R   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s0    								$
 
c         C   s?   | o |  i  Sn) g  } |  i D] } | | i   q! ~ Sd S(   s5   Return the axes rectangle left, bottom, width, heightN(   R   R   R   (   RJ   t   originalR$   Re   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_position  s    t   bothc         C   s_   | d j o4 x1 t  | |  i  D] \ } } | i |  q  Wn | d j o | |  _ n d S(   s  
        Set the axes position with pos = [left, bottom, width, height]
        in relative 0,1 coords

        There are two position variables: one which is ultimately
        used, but which may be modified by apply_aspect, and a second
        which is the starting point for apply_aspect.

        which = 'active' to change the first;
                'original' to change the second;
                'both' to change both

        ACCEPTS: len(4) sequence of floats
        R  t   activeR  N(   s   bothR  (   s   boths   original(   R   R   t   setR   (   RJ   t   post   whicht   numRe   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_position  s     c         C   s>   | i  |  i  | i   p | i |  i  n |  | _ d S(   s3   set the boilerplate props for artists added to axesN(   R   R   t   is_transform_sett   set_transformR   RG   (   RJ   t   a(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _set_artist_props  s    c         C   s  |  i  i   |  i i   |  i d  |  i d  |  i i d  t i d!  |  _	 |  i
 d  j	 o. |  i
 i  i |  i  _ |  i
 i  i |  i  _ n |  i d  j	 o. |  i i i |  i _ |  i i i |  i _ n t |   |  _ t |  d  |  _ t d |  _ g  |  _ g  |  _ g  |  _ g  |  _ g  |  _ g  |  _ d  |  _ g  |  _ t |  _ |  i |  i  t i  d t d  } t! i" d	 d
 d d d d d | d d d d  |  _# |  i# i$ |  i%  |  i# i& d   |  i' |  i#  t( i) d d" d d d d d |  i* d t d  |  _+ |  i+ i, |  i-  |  i+ i$ |  i%  |  i+ i. t d  t/ i0 d# d$ d t d d t d d |  i- |  _1 |  i1 i$ |  i%  |  i1 i2 d  t |  _3 d  S(%   s   Clear the current axesR   i   R   R   Ri   s	   axes.gridt   sizes   axes.titlesizeR%   g      ?RD   gRQ?R   R*   t   fontpropertiest   verticalalignmentR   t   horizontalalignmentt   centert   xyi    t   widtht   heightR   t	   edgecolors   axes.edgecolors   axes.linewidtht	   linewidthR;   R   g      @N(   s   xlim_changeds   ylim_changed(   i    i    (   i    i   i   i    i    (   i    i    i   i   i    (4   RV   R   RW   t
   set_xscalet
   set_yscaleR   t   ignoreR   t   CallbackRegistryR   R   R,   t   majort   minorR   R?   t
   _get_linest   _get_patches_for_fillR7   t   _gridOnR   R   t   textst   tablest   artistst   imagest   legend_R   Rs   t   _autoscaleont   gridR
   t   FontPropertiest   mtextt   Textt   titleR  R   t   set_clip_boxR  R   t	   RectangleR   t	   axesPatchR   R   t   set_linewidthR3   R   t	   axesFramet
   set_zordert   axison(   RJ   t   props(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s`    												

c         C   s   |  i    d S(   s   clear the axesN(   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   clear  s    c         C   s   |  i  S(   s"   return the HOLD status of the axes(   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   ishold  s    c         C   s+   | d j o |  i |  _ n
 | |  _ d S(   s  
        HOLD(b=None)

        Set the hold state.  If hold is None (default), toggle the
        hold state.  Else set the hold state to boolean value b.

        Eg
            hold()      # toggle hold
            hold(True)  # hold is on
            hold(False) # hold is off


        When hold is True, subsequent plot commands will be added to
        the current axes.  When hold is False, the current axes and
        figure will be cleared on the next plot command

        N(   R,   R   (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   hold  s    c         C   s   |  i  S(   N(   t   _aspect(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_aspect*  s    c         C   s   | d j o d |  _  n* | d j o d |  _  n t |  |  _  | d j	 o |  i |  n | d j	 o |  i |  n d S(   s  
        aspect:
           'auto'   -  automatic; fill position rectangle with data
           'normal' -  same as 'auto'; deprecated
           'equal'  -  same scaling from data to plot units for x and y
            num     -  a circle will be stretched such that the height
                       is num times the width. aspect=1 is the same as
                       aspect='equal'.

        adjustable:
            'box'      - change physical size of axes
            'datalim'  - change xlim or ylim

        anchor:
            'C'     - centered
            'SW'    - lower left corner
            'S'     - middle of bottom edge
            'SE'    - lower right corner
                 etc.

        ACCEPTS: ['auto' | 'equal' | aspect_ratio]
        t   normalR   t   equalN(   s   normals   auto(   R8  t   floatR,   R   R   (   RJ   t   aspectt
   adjustablet   anchor(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   -  s    c         C   s   |  i  S(   N(   t   _adjustable(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_adjustableP  s    c         C   s*   | d j o | |  _  n t d   d S(   s.   
        ACCEPTS: ['box' | 'datalim']
        R   t   datalims$   argument must be "box", or "datalim"N(   s   boxRB  (   R@  R0   (   RJ   R>  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   S  s    c         C   s   |  i  S(   N(   t   _anchor(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_anchor\  s    c         C   s_   | t  i i i   j p t |  d j o | |  _ n# t d d i t i i      d S(   sL   
        ACCEPTS: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
        i   s   argument must be among %ss   , N(   R   t   PBoxt   coefst   keysR   RC  R0   t   join(   RJ   R?  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   _  s    ,c   )      C   s  |  i  d j o |  i |  i d  d Sn |  i  d j o
 d } n
 |  i  } |  i p |  i p |  i p
 |  i o d |  _ n |  i   i	   \ } } | | } |  i
   \ } } t t i | |  d  } |  i   \ }	 }
 t t i |
 |	  d  } |  i d j om | d j o | | } n | | } t i |  i  } | i | |  } |  i | i |  i  d  d Sn |  i d	 t  \ } } } } | | | } | | } | | | d
 } t |  d j  o d Sn |  i } d | i   } d | i   } | | } | | } | | } | | } | | } | | } d } d } |  i p
 |  i o |  i p |  i } |  i p
 |  i o |  i p |  i }  | o |  o t i d  d Sn | o
 t }! nk | | j oD | | j o7 | d j o | d j  p | d j  o
 | d j }" n | d j }" |  p |" }! |! oA d |	 |
 }# |# | d }$ |# | d }% |  i |$ |% f  n> d | | }& |& | d }' |& | d }( |  i |' |( f  d S(   s   
        Use self._aspect and self._adjustable to modify the
        axes box or the view limits.
        The data_ratio kwarg is set to 1 for polar axes.  It is
        used only when _adjustable is 'box'.
        R   R  NR;  i   RB  gKH9R   R  g      ?g{Gzt?g?i    s9   adjustable='datalim' cannot work with shared x and y axesg      ?g       @(    R8  R
  R   R   R   R   R   R@  t
   get_figuret   get_size_inchest
   get_xboundt   maxt   matht   fabst
   get_yboundR,   R   RE  t   shrink_to_aspectR?  RC  R  Rs   t   absR   R  R  t   warningst   warnRo   t
   set_yboundt
   set_xbound()   RJ   t
   data_ratiot   At   figWt   figHt
   fig_aspectR   R   t   xsizeR   R   t   ysizet
   box_aspectt   pbt   pb1R   R@   R   R   t
   y_expandert   dLt   xrt   yrt   xmargt   ymargt   Ysizet   Xsizet   Xmargt   Ymargt   xmt   ymt   changext   changeyt   adjust_yt   adjyt   yct   y0t   y1t   xct   x0t   x1(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   apply_aspectj  s|    
	(


	






c   	      O   s  t  |  d j ot | d  o| d i   } | d j o |  i   n;| d j o |  i   n | d j o|  i t  |  i d	  |  i   |  i	   | d j o |  i d d d q| d j o* |  i d d d d d |  i t
  q| d j o! |  i d t  |  i t
  q| d
 j o: |  i d t  |  i t
  |  i d d d d d qn t d |   |  i   \ } } |  i   \ } } | | | | f Sn y | d Wn t j
 o | i d t
  } | i d d  } | i d d  } |  i | | |  \ } } | i d d  } | i d d  } |  i | | |  \ } } | | | | f Sn X| d } t  |  d j o t d   n |  i | d | d g  |  i | d | d g  | S(   s   
        Convenience method for manipulating the x and y view limits
        and the aspect ratio of the plot.

        kwargs are passed on to set_xlim and set_ylim -- see their
        docstrings for details
        i   i    t   ont   offR;  t   tightt   scaledR:  R   R   R>  RB  R   R?  R   s-   Unrecognized string %s to axis; try on or offR   R   R   R   R   i   s$   v must contain [xmin xmax ymin ymax]i   i   (   s   equals   tights   scaleds   normals   autos   imageN(   R   R   t   lowert   set_axis_ont   set_axis_offt   set_autoscale_onRs   R   t   autoscale_viewRv  Ro   R0   R   R   t
   IndexErrorR   R,   R   R   (	   RJ   R   R\   t   sR   R   R   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     sR    $

!
c         C   s   t  d   d S(   sI   
        Return a list of artists the axes contains.  Deprecated
        s   Use get_children insteadN(   t   DeprecationWarning(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_child_artists  s    c         C   s   |  i  S(   s   Return the axes Rectangle frame(   R/  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   get_frame  s    c         C   s   |  i  S(   sB   Return the legend.Legend instance, or None if no legend is defined(   R&  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_legend  s    c         C   s   t  i d |  i  S(   s2   return a list of Axes images contained by the Axest	   AxesImage(   R   t   silent_listR%  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_images  s    c         C   s   t  i d |  i  S(   s,   Return a list of lines contained by the AxesR   (   R   R  R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   get_lines  s    c         C   s   |  i  S(   s   Return the XAxis instance(   RV   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   get_xaxis  s    c         C   s   t  i d |  i i    S(   s2   Get the x grid lines as a list of Line2D instancess   Line2D xgridline(   R   R  RV   t   get_gridlines(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_xgridlines!  s    c         C   s   t  i d |  i i    S(   s1   Get the xtick lines as a list of Line2D instancess   Text xtickline(   R   R  RV   t   get_ticklines(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_xticklines&  s    c         C   s   |  i  S(   s   Return the YAxis instance(   RW   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   get_yaxis+  s    c         C   s   t  i d |  i i    S(   s2   Get the y grid lines as a list of Line2D instancess   Line2D ygridline(   R   R  RW   R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_ygridlines/  s    c         C   s   t  i d |  i i    S(   s1   Get the ytick lines as a list of Line2D instancess   Line2D ytickline(   R   R  RW   R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_yticklines3  s    c         C   s:   t  |  i  t  |  i  t  |  i  t  |  i  d j S(   s   Return true if any artists have been added to axes.

        This should not be used to determine whether the dataLim
        need to be updated, and may not actually be useful for
        anything.
        i    (   R   R   R%  R   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   has_data9  s    
&c            s@   | i       i i |    i |    f d   | _ d S(   s   Add any artist to the axesc            s     i  i |   S(    (   R$  t   remove(   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   <lambda>K  s    N(   R   R$  R"   R  t   _remove_method(   RJ   R  (    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   add_artistF  s    c            s   | i    } | p | i d t   i   n   i i |    i |  | i   i  | o   i | i	   i
   n   f d   | _ d S(   s!   add a Collection instance to Axess   collection%dc            s     i  i |   S(    (   R   R  (   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  W  s    N(   t	   get_labelR   R   R   R"   R  R-  R   t   update_datalimt	   get_vertsR   R  (   RJ   t
   collectiont   autolimR   (    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   add_collectionM  s    c            s{     i  |  | i   i    i |  | i   p | i d t   i   n   i i |    f d   | _	 d S(   s$   Add a line to the list of plot liness   _line%dc            s     i  i |   S(    (   R   R  (   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  b  s    N(
   R  R-  R   t   _update_line_limitsR  R   R   R   R"   R  (   RJ   Rc   (    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   add_lineY  s    c   	      C   s   | i  d t  } | i d t  } | i   |  i j o |  i | i   t | |   } t i g  } | D] \ } } | | ql ~  } t i g  } | D] \ } } | | q ~  } n |  i	 | |  d  S(   Nt   orig(
   t	   get_xdataRo   t	   get_ydatat   get_transformR   t   _get_verts_in_data_coordsR   Rm   t   arrayt   update_datalim_numerix(	   RJ   Rc   t   xdatat   ydatat   xysR$   R%   RD   t   _[2](    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  d  s    04c            sP     i  |  | i   i    i |    i i |    f d   | _ d S(   s   
        Add a patch to the list of Axes patches; the clipbox will be
        set to the Axes clipping box.  If the transform is not set, it
        wil be set to self.transData.
        c            s     i  i |   S(    (   R   R  (   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  |  s    N(   R  R-  R   t   _update_patch_limitsR   R"   R  (   RJ   t   p(    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   add_patchq  s
    c         C   s/   |  i  | i   | i    } |  i |  d S(   s!   update the datalimits for patch pN(   R  R  R  R  (   RJ   R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  ~  s    c            s3     i  |    i i |    f d   | _ d S(   s/   Add a table instance to the list of axes tablesc            s     i  i |   S(    (   R#  R  (   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    N(   R  R#  R"   R  (   RJ   t   tab(    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   add_table  s    c         C   sV   |  i  i t  x |  i D] } |  i |  q Wx |  i D] } |  i |  q; Wd S(   s1   recompute the datalimits based on current artistsN(   R   R  Rs   R   R  R   R  (   RJ   Rc   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    
 
 c         C   s&   t  i |  } |  i i | d  d S(   s@   Update the data lim bbox with seq of xy tups or equiv. 2-D arrayiN(   Rm   Rp   R   t   update_numerix_xy(   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    c         C   s   |  i  i | | d  d S(   s,   Update the data lim bbox with seq of xy tupsiN(   R   t   update_numerix(   RJ   R%   RD   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    c         C   s@   | |  i  j o | Sn | i t i |   } |  i  i |  S(   N(   R   t
   numerix_xyRm   Rp   t   inverse_numerix_xy(   RJ   t   transR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    c         C   s   |  i  d j p |  i d j o d Sn | d j	 o |  i  i |  n | d j	 o |  i i |  n | d j	 o | i d |  i  i  } | |  i  i j o |  i  i |  n | i d |  i i  } | |  i i j o |  i i |  q n d S(   s?   look for unit kwargs and update the axis instances as necessaryNRT   RU   (   RV   R,   RW   Rl   RX   RY   RZ   (   RJ   R  R  R\   RT   RU   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _process_unit_info  s    (c         C   s   |  i  i | |  S(   sD   return True is the point xwin, ywin (display coords) are in the Axes(   R   t   contains(   RJ   t   xwint   ywin(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   in_axes  s    c         C   s   |  i  S(   sE   
        Get whether autoscaling is applied on plot commands
        (   R'  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_autoscale_on  s    c         C   s   | |  _  d S(   sb   
        Set whether autoscaling is applied on plot commands

        ACCEPTS: True|False
        N(   R'  (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR~    s    c   	      C   s-  |  i  p d Sn | pB t |  i  d j o t |  i  d j ol t |  i  d j oV | o  |  i |  i i   i    n | o  |  i	 |  i i
   i    n d Sn | o2 |  i   } |  i i   i   } |  i |  n | o8 |  i i   } |  i   } | i   } |  i	 |  n d S(   s	  
        autoscale the view limits using the data limits. You can
        selectively autoscale only a single axis, eg, the xaxis by
        setting scaley to False.  The autoscaling preserves any
        axis direction reversal that has already been done.
        Ni    (   R'  R   R%  R   R   RU  R   t	   intervalxt
   get_boundsRT  t	   intervalyRK  RV   t   get_major_locatort	   autoscaleRW   RO  (	   RJ   Ry  t   scalext   scaleyt   xlt   XLt   ylocatort   ylt   YL(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s     	''c         C   s  | d j o |  i } n | d j o t d   n |  i   p d Sn | i d  |  i   |  i i   |  i i   |  i	 o |  i
 o |  i i |  n g  } t |  i  d j p | i   o% x |  i D] } | i |  q Wn | i   } g  } |  i D]0 } | i   o | | i |  d d f qq~ } t i |  i i   | |  i i   | |  } t | _ |  i i   \ } }	 }
 } | i | |	 | |  i  | i |  i  | i |  i  | i |  i  | i |  i  | i |  i   |  i	 os | ok |  i! o$ |  i" i# d  |  i$ i# d  n! |  i" i# d  |  i$ i# d  | i |  i" |  i$ g  n | p | i% |  i&  n | i |  i'  |  i( d j	 o | i% |  i(  n |  i	 o |  i
 o | i% |  i)  n g  } t* |  D]0 \ } } | i+   p | | i, | | f qq~ } | i-   x$ | D] \ } } } | i |  qQW|  i i.   |  i i.   | i/ d  | |  _ d S(   s*   Draw everything (plot lines, axes, labels)s   No renderer definedNRG   i   i    g      ?g      @(0   R,   R   t   RuntimeErrort   get_visiblet
   open_groupRv  R   t   freezeR   R3  R   R/  t   drawR   R%  t   option_image_nocompositet   get_image_magnificationt
   make_imaget   mimaget   from_imagesR   R  R  Ro   t   is_grayscaleR  t
   draw_imaget   extendR   R   R   R"  R$  R   RV   R2  RW   R"   R,  R#  R&  R1  t	   enumeratet   get_animatedt   zordert   sortt   thawt   close_group(   RJ   t   renderert   inframeR$  t   imt   magR$   t   imsR   R@   R   R   R  t   iR  t   dsuR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    sh    
(#
 @		
-
 c         C   s+   |  i  d j	 p t  | i |  i   d S(   s   
        This method can only be used after an initial draw which
        caches the renderer.  It is used to efficiently update Axes
        data (axis ticks, labels, etc are not updated)
        N(   R   R,   R_   R  (   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   draw_artistH  s    c         C   s1   |  i  d j	 p t  |  i |  i  d t d S(   s   
        This method can only be used after an initial draw which
        caches the renderer.  It is used to efficiently update Axes
        data (axis ticks, labels, etc are not updated)
        R  N(   R   R,   R_   R  Rs   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   redraw_in_frameQ  s    c         C   s   |  i  S(   N(   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_renderer_cacheZ  s    c         C   s   |  i  d  j o t d   n g  } |  i i   D] } | | i | f q4 ~ } | i   |  i  } | i   x! | D] \ } } | i |  qw Wd  S(   Ns   You must first call ax.draw()(	   t   _lastRendererR,   R  t   animatedRG  R  R  t   blitR  (   RJ   R$   R  R  R  t   tmp(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   __draw_animate]  s    3
	
 c         C   s   |  i  S(   s?   
        Get whether the axes rectangle patch is drawn
        (   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_frame_onj  s    c         C   s   | |  _  d S(   s\   
        Set whether the axes rectangle patch is drawn

        ACCEPTS: True|False
        N(   R   (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_frame_onp  s    c         C   s   |  i  S(   s8   
        Get whether axist below is true or not
        (   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_axisbelowx  s    c         C   s   | |  _  d S(   sw   
        Set whether the axis ticks and gridlines are above or below most artists

        ACCEPTS: True|False
        N(   R   (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_axisbelow~  s    c         K   sA   t  |  o
 t } n |  i i | |  |  i i | |  d S(   s  
        GRID(self, b=None, **kwargs)
        Set the axes grids on or off; b is a boolean

        if b is None and len(kwargs)==0, toggle the grid state.  if
        kwargs are supplied, it is assumed that you want a grid and b
        is thus set to True

        kawrgs are used to set the grid line properties, eg

          ax.grid(color='r', linestyle='-', linewidth=2)

        Valid Line2D kwargs are
        %(Line2D)s
        N(   R   Rs   RV   R(  RW   (   RJ   R@   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR(    s    c         K   s%  | i  d d  i   } | i  d d  i   } | d  d j o
 t } n^ | d j o0 t } | d j o
 t } q t } t d	  n! | d j o
 d } n
 t d
  | d j	 ol | d j p | d j o |  i i i	 i
 |  n | d j p | d j o |  i i i	 i
 |  q!n d S(   sB  
        Convenience method for manipulating the ScalarFormatter
        used by default for linear axes.

        kwargs:
            style = 'sci' (or 'scientific') or 'plain';
                        plain turns off scientific notation
            axis = 'x', 'y', or 'both'

        Only the major ticks are affected.
        If the method is called when the ScalarFormatter is not
        the one being used, an AttributeError will be raised with
        no additional error message.

        Additional capabilities and/or friendlier error checking may be added.

        t   styleR*   R   R  i   t   scit   plaint   commas   comma style remains to be addeds   %s is not a valid style valueR%   RD   N(   R  s   comma(   RX   R{  Rs   Ro   t   NotImplementedErrorR,   R0   RV   R  t	   formattert   set_scientificRW   (   RJ   R\   R  R   t   sbt   cb(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   ticklabel_format  s$    


	c         C   s   t  |  _ d S(   s:   
        turn off the axis

        ACCEPTS: void
        N(   Ro   R3  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR}    s    c         C   s   t  |  _ d S(   s9   
        turn on the axis

        ACCEPTS: void
        N(   Rs   R3  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR|    s    c         C   s   |  i  S(   s    Return the axis background color(   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_axis_bgcolor  s    c         C   s   | |  _  |  i i |  d S(   si   
        set the axes background color

        ACCEPTS: any matplotlib color - see help(colors)
        N(   R   R/  t   set_facecolor(   RJ   R;   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_axis_bgcolor  s    	c         C   s&   |  i    \ } } |  i | |  d S(   s   Invert the x-axis.N(   R   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   invert_xaxis  s    c         C   s   |  i    \ } } | | j  S(   s'   Returns True if the x-axis is inverted.(   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   xaxis_inverted  s    c         C   s;   |  i    \ } } | | j  o | | f Sn | | f Sd S(   sJ   Returns the x-axis numerical bounds in the form of lowerBound < upperBoundN(   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK    s    c         C   s   | d j o t |  o | \ } } n |  i   \ } } | d j o
 | } n | d j o
 | } n |  i   o5 | | j  o |  i | |  q |  i | |  n2 | | j  o |  i | |  n |  i | |  d S(   s   Set the lower and upper numerical bounds of the x-axis.
           This method will honor axes inversion regardless of parameter order.
        N(   R,   R   RK  R  R   (   RJ   R{  t   uppert	   old_lowert	   old_upper(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRU    s    c         C   s   |  i  i   i   S(   s!   Get the x axis range [xmin, xmax](   R   R  R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         K   sd  | d j o t |  o | \ } } n |  i d | | f  | d j	 o |  i |  } n | d j	 o |  i |  } n |  i   \ } } | d j o
 | } n | d j o
 | } n |  i i   i   t i	 j o& t
 | |  d j o t d   n t i | | d t \ } } |  i i   i | |  | o |  i i d |   n | | f S(   s  
        set_xlim(self, *args, **kwargs):

        Set the limits for the xaxis; v = [xmin, xmax]

        set_xlim((valmin, valmax))
        set_xlim(valmin, valmax)
        set_xlim(xmin=1) # xmax unchanged
        set_xlim(xmax=1) # xmin unchanged

        Valid kwargs:

        xmin : the min of the xlim
        xmax : the max of the xlim
        emit : notify observers of lim change


        Returns the current xlimits as a length 2 tuple

        ACCEPTS: len(2) sequence of floats
        R  i    s0   Cannot set nonpositive limits with log transformt
   increasingR   N(   R,   R   R  t   convert_xunitsR   R   R   t   get_typeR   t   LOG10t   minR0   t   nonsingularRo   R   R  t
   set_boundsR   t   process(   RJ   R   R   R   R\   t   old_xmint   old_xmax(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s"    c         C   s   |  i  |  i i   i   S(   s,   return the xaxis scale string: log or linear(   Rz  R   R   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_xscale?  s    i
   c         C   sN  | i    d j p t  | d j o |  i i t i |   |  i i t i |   |  i i t i | |   |  i	 i
   i t i  |  i   \ } } t | |  d j o |  i   qJn | d j ou |  i i t i    |  i i t i    |  i i t i    |  i i t i    |  i	 i
   i t i  n d S(   sF  
        SET_XSCALE(value, basex=10, subsx=None)

        Set the xscaling: 'log' or 'linear'

        If value is 'log', the additional kwargs have the following meaning

            * basex: base of the logarithm

            * subsx: a sequence of the location of the minor ticks;
              None defaults to autosubs, which depend on the number of
              decades in the plot.  Eg for base 10, subsx=(1,2,5) will
              put minor ticks on 1,2,5,11,12,15,21, ....To turn off
              minor ticking, set subsx=[]

        ACCEPTS: ['log' | 'linear' ]
        R   R   i    N(   s   logs   linear(   R{  R_   RV   t   set_major_locatort   mtickert
   LogLocatort   set_major_formattert   LogFormatterMathtextt   set_minor_locatorR   R   t   set_typeR   R  R   R  R  t   AutoLocatort   ScalarFormattert   NullLocatort   set_minor_formattert   NullFormattert   IDENTITY(   RJ   t   valuet   basext   subsxt   minxt   maxx(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  C  s    c         C   s   |  i  i d |  S(   s)   Return the x ticks as a list of locationsR  (   RV   t   get_ticklocs(   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_xticksg  s    c         C   s   |  i  i | d | S(   sY   
        Set the x ticks with list of ticks

        ACCEPTS: sequence of floats
        R  (   RV   t	   set_ticks(   RJ   t   ticksR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   set_xticksk  s    c         C   s   t  i d |  i i    S(   s0   Get the xtick labels as a list of Text instancess   Text xticklabel(   R   R  RV   t   get_majorticklabels(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_xmajorticklabelss  s    c         C   s   t  i d |  i i    S(   s0   Get the xtick labels as a list of Text instancess   Text xticklabel(   R   R  RV   t   get_minorticklabels(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_xminorticklabelsw  s    c         C   s   t  i d |  i i d |   S(   s0   Get the xtick labels as a list of Text instancess   Text xticklabelR  (   R   R  RV   t   get_ticklabels(   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_xticklabels{  s    c         K   s   |  i  i | | d | | S(   s-  
        set_xticklabels(labels, fontdict=None, minor=False, **kwargs)

        Set the xtick labels with list of strings labels Return a list of axis
        text instances.

        kwargs set the Text properties.  Valid properties are
        %(Text)s

        ACCEPTS: sequence of strings
        R  (   RV   t   set_ticklabels(   RJ   t   labelst   fontdictR  R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_xticklabels  s    c         C   s&   |  i    \ } } |  i | |  d S(   s   Invert the y-axis.N(   R   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   invert_yaxis  s    c         C   s   |  i    \ } } | | j  S(   s'   Returns True if the y-axis is inverted.(   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   yaxis_inverted  s    c         C   s;   |  i    \ } } | | j  o | | f Sn | | f Sd S(   sJ   Returns the y-axis numerical bounds in the form of lowerBound < upperBoundN(   R   (   RJ   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRO    s    c         C   s   | d j o t |  o | \ } } n |  i   \ } } | d j o
 | } n | d j o
 | } n |  i   o5 | | j  o |  i | |  q |  i | |  n2 | | j  o |  i | |  n |  i | |  d S(   s   Set the lower and upper numerical bounds of the y-axis.
           This method will honor axes inversion regardless of parameter order.
        N(   R,   R   RO  R+  R   (   RJ   R{  R  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRT    s    c         C   s   |  i  i   i   S(   s!   Get the y axis range [ymin, ymax](   R   R  R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         K   sN  | d j o t |  o | \ } } n | d j	 o |  i |  } n | d j	 o |  i |  } n |  i   \ } } | d j o
 | } n | d j o
 | } n |  i i   i   t i j o& t	 | |  d j o t
 d   n t i | | d t \ } } |  i i   i | |  | o |  i i d |   n | | f S(   s  
        set_ylim(self, *args, **kwargs):

        Set the limits for the yaxis; v = [ymin, ymax]

        set_ylim((valmin, valmax))
        set_ylim(valmin, valmax)
        set_ylim(ymin=1) # ymax unchanged
        set_ylim(ymax=1) # ymin unchanged

        Valid kwargs:

        ymin : the min of the ylim
        ymax : the max of the ylim
        emit : notify observers of lim change

        Returns the current ylimits as a length 2 tuple

        ACCEPTS: len(2) sequence of floats
        i    s0   Cannot set nonpositive limits with log transformR  R   N(   R,   R   t   convert_yunitsR   R   R  R   R   R  R  R0   R  Ro   R   R  R  R   R  (   RJ   R   R   R   R\   t   old_ymint   old_ymax(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s     c         C   s   |  i  |  i i   i   S(   s,   return the yaxis scale string: log or linear(   Rz  R   R  R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_yscale  s    c         C   sN  | i    d j p t  | d j o |  i i t i |   |  i i t i |   |  i i t i | |   |  i	 i
   i t i  |  i   \ } } t | |  d j o |  i   qJn | d j ou |  i i t i    |  i i t i    |  i i t i    |  i i t i    |  i	 i
   i t i  n d S(   sF  
        SET_YSCALE(value, basey=10, subsy=None)

        Set the yscaling: 'log' or 'linear'

        If value is 'log', the additional kwargs have the following meaning

            * basey: base of the logarithm

            * subsy: a sequence of the location of the minor ticks;
              None defaults to autosubs, which depend on the number of
              decades in the plot.  Eg for base 10, subsy=(1,2,5) will
              put minor ticks on 1,2,5,11,12,15, 21, ....To turn off
              minor ticking, set subsy=[]

        ACCEPTS: ['log' | 'linear']
        R   R   i    N(   s   logs   linear(   R{  R_   RW   R	  R
  R  R  R  R  R   R  R  R   R  R   R  R  R  R  R  R  R  R  (   RJ   R  t   baseyt   subsyt   minyt   maxy(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    c         C   s   |  i  i d |  S(   s)   Return the y ticks as a list of locationsR  (   RW   R  (   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   get_yticks  s    c         C   s   |  i  i | d | S(   sY   
        Set the y ticks with list of ticks

        ACCEPTS: sequence of floats
        R  (   RW   R  (   RJ   R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   set_yticks  s    c         C   s   t  i d |  i i    S(   s0   Get the xtick labels as a list of Text instancess   Text yticklabel(   R   R  RW   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_ymajorticklabels  s    c         C   s   t  i d |  i i    S(   s0   Get the xtick labels as a list of Text instancess   Text yticklabel(   R   R  RW   R"  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_yminorticklabels#  s    c         C   s   t  i d |  i i d |   S(   s0   Get the xtick labels as a list of Text instancess   Text yticklabelR  (   R   R  RW   R$  (   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_yticklabels'  s    c         K   s   |  i  i | | d | | S(   s5  
        set_yticklabels(labels, fontdict=None, minor=False, **kwargs)

        Set the ytick labels with list of strings labels.  Return a list of
        Text instances.

        kwargs set Text properties for the labels.  Valid properties are
        %(Text)s

        ACCEPTS: sequence of strings
        R  (   RW   R&  (   RJ   R'  R(  R  R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_yticklabels+  s    c         C   s[   |  i  i   i   } | t i j o |  i d  n" | t i j o |  i d  n d S(   s+   toggle between log and linear on the y axisR   R   N(   R   R  R   R   R  R  R  (   RJ   t   funcy(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   toggle_log_lineary:  s    !c         C   s   |  i  i   } t | t i  p# t i |  } |  i  i |  n |  i  i   } t | t i  p# t i	 |  } |  i  i
 |  n d S(   s   Sets up x-axis ticks and labels that treat the x data as dates.

        tz is the time zone to use in labeling dates.  Defaults to rc value.
        N(   RV   R  t
   isinstancet   mdatest   DateLocatort   AutoDateLocatorR	  t   get_major_formattert   DateFormattert   AutoDateFormatterR  (   RJ   t   tzt   locatorR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   xaxis_date@  s    c         C   s   |  i  i   } t | t i  p# t i |  } |  i  i |  n |  i i   } t | t i	  p# t i
 |  } |  i  i |  n d S(   s   Sets up y-axis ticks and labels that treat the y data as dates.

        tz is the time zone to use in labeling dates.  Defaults to rc value.
        N(   RW   R  R<  R=  R>  R?  R	  RV   R@  RA  RB  R  (   RJ   RC  RD  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   yaxis_dateP  s    c         C   sM   y |  i  |  SWn5 t j
 o) |  i i   i } | |  } | Sn Xd S(   s   
        Return x string formatted.  This function will use the attribute
        self.fmt_xdata if it is callable, else will fall back on the xaxis
        major formatter
        N(   R   Ra   RV   R@  t   format_data_short(   RJ   R%   Rg   Re   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   format_xdata`  s
    c         C   sM   y |  i  |  SWn5 t j
 o) |  i i   i } | |  } | Sn Xd S(   s   
        Return y string formatted.  This function will use the attribute
        self.fmt_ydata if it is callable, else will fall back on the yaxis
        major formatter
        N(   R   Ra   RW   R@  RG  (   RJ   RD   Rg   Re   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   format_ydatal  s
    c         C   s,   |  i  |  } |  i |  } d | | f S(   s0   return a format string formatting the x, y coords
   x=%s, y=%s(   RH  RI  (   RJ   R%   RD   t   xst   ys(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   format_coordx  s    c         C   s   |  i  S(   sF   
        Get whether the axes responds to navigation commands
        (   t	   _navigate(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_navigate  s    c         C   s   | |  _  d S(   sk   
        Set whether the axes responds to navigation toolbar commands

        ACCEPTS: True|False
        N(   RM  (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         C   s   |  i  S(   sR   
        Get the navigation toolbar button status: 'PAN', 'ZOOM', or None
        (   t   _navigate_mode(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_navigate_mode  s    c         C   s   | |  _  d S(   se   
        Set the navigation toolbar button status;
        this is not a user-API function.

        N(   RO  (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         C   s   |  i  S(   sq   return the cursor props as a linewidth, color tuple where
        linewidth is a float and color is an RGBA tuple(   t   _cursorProps(   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_cursor_props  s    c         G   s{   t  |  d j o | d \ } } n0 t  |  d j o | \ } } n t d   t i i |  } | | f |  _ d S(   s   
        Set the cursor property as
        ax.set_cursor_props(linewidth, color)  OR
        ax.set_cursor_props((linewidth, color))

        ACCEPTS: a (float, color) tuple
        i   i    i   s'   args must be a (linewidth, color) tupleN(   R   R0   R-   R.   t   to_rgbaRQ  (   RJ   R#   t   lwR<   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         C   s   t  d   d S(   s  
        Register observers to be notified when certain events occur.  Register
        with callback functions with the following signatures.  The function
        has the following signature

            func(ax)  # where ax is the instance making the callback.

        The following events can be connected to:

          'xlim_changed','ylim_changed'

        The connection id is is returned - you can use this with
        disconnect to disconnect from the axes event

        s3   use the callbacks CallbackRegistry instance insteadN(   R  (   RJ   R  Rg   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         C   s   t  d   d S(   s   disconnect from the Axes event.s3   use the callbacks CallbackRegistry instance insteadN(   R  (   RJ   t   cid(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   disconnect  s    c         C   s   g  } | i  |  i  | i  |  i  | i |  i  | i |  i  | i |  i  | i |  i  | i |  i  | i |  i	  |  i
 d j	 o | i  |  i
  n | i |  i  | i  |  i  | i  |  i  | i  |  i  | S(   s   return a list of child artistsN(   R"   RV   RW   R  R   R   R"  R#  R$  R%  R&  R,   R   R,  R/  R1  (   RJ   t   children(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_children  s     c         C   sI   t  |  i  o |  i |  |  Sn |  i i | i | i  } | h  f S(   sS   Test whether the mouse event occured in the axes.

        Returns T/F, {}
        (   t   callablet	   _containsR   R  R%   RD   (   RJ   t
   mouseeventt   inside(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    $c         G   s>   t  |  d j o t d   n t i i |  | d  d S(   s   
        pick(mouseevent)

        each child artist will fire a pick event if mouseevent is over
        the artist and the artist has picker set
        i   sC   New pick API implemented -- see API_CHANGES in the src distributioni    N(   R   R  R   R   t   pick(   RJ   R#   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR]    s    c      
      sr  | d j	 o | i | | f    n | | f   d   } d       f d   } |  i |  i |  i } t |  o t t |  } n t |  oc t	 g  } | D] }	 | |	 d f q ~  }
 g  } | D] } | |
 j o | | q q ~ } n | d j o n t
 d   t |  p d Sn g  } | D] } | | |  | f q:~ } | i   | d d S(   s  
        Return the artist under point that is closest to the x, y.  if trans
        is None, x, and y are in window coords, 0,0 = lower left.  Otherwise,
        trans is a matplotlib transform that specifies the coordinate system
        of x, y.

        The selection of artists from amongst which the pick function
        finds an artist can be narrowed using the optional keyword
        argument among. If provided, this should be either a sequence
        of permitted artists or a function taking an artist as its
        argument and returning a true value if and only if that artist
        can be selected.

        Note this algorithm calculates distance to the vertices of the
        polygon, so if you want to pick a patch, click on the edge!
        c         S   s9   |  \ } } | \ } } t  i | | d | | d  S(   s&   return the distance between two pointsi   (   RM  t   sqrt(   t   p1t   p2Ru  Rr  t   x2t   y2(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   dist_points	  s    c         S   s3   |  \ } } t  t i | | d | | d   S(   s<   x and y are arrays; return the distance to the closest pointi   (   R  Rm   R^  (   R_  R%   RD   Ru  Rr  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   dist_x_y  s    c            sF  t  |  t  ot |  i   } | i   \ } } } } | | f | | | f | | | | f | | | f f } t |   \ } } n t  |  t  o7 |  i   } |  i   i |  }	 t |	   \ } } nZ t  |  t	 i
  oF |  i d t  }
 |  i d t  } |  i   i |
 |  \ } } n    t i |  t i |   S(   NR  (   R<  R+  R   R  R   t   PatchR  R  t   seq_xy_tupsR3   R   R  Ro   R  t   numerix_x_yRm   Rp   (   R  R   R   R@   R   R   t   vertst   xtt   ytt   tvertsR  R  (   Rd  t   xywin(    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   dist  s    :"i   s"   among must be callable or iterablei    N(   R,   t   xy_tupR   R   R"  RY  t   filtert   testR   t   dictR0   R   R  (   RJ   R%   RD   R  t   amongRc  Rm  R$  R$   RE   t   amongdR  R  t   _[3]t   ds(    (   Rl  Rd  s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   __pick  s&    		-6-
c         K   s}   h  t  d d <d d <d d <} |  i i |  |  i i |  | d j	 o |  i i |  n |  i i |  |  i S(   s  
        SET_TITLE(label, fontdict=None, **kwargs):

        Set the title for the axes.  See the text docstring for information
        of how override and the optional args work

        kwargs are Text properties:
        %(Text)s

        ACCEPTS: str
        s   axes.titlesizet   fontsizeR   R  R  R  N(   R7   R,  t   set_textt   updateR,   (   RJ   R   R(  R\   t   default(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   set_title8  s    	!c         K   sK   |  i  i   } | i |  | d j	 o | i |  n | i |  | S(   s  
        SET_XLABEL(xlabel, fontdict=None, **kwargs)

        Set the label for the xaxis.  See the text docstring for information
        of how override and the optional args work.

        Valid kwargs are Text properties:
        %(Text)s
        ACCEPTS: str
        N(   RV   R  Rx  R,   Ry  (   RJ   t   xlabelR(  R\   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   set_xlabelQ  s
    c         K   sK   |  i  i   } | i |  | d j	 o | i |  n | i |  | S(   s  
        SET_YLABEL(ylabel, fontdict=None, **kwargs)

        Set the label for the yaxis

        See the text doctstring for information of how override and
        the optional args work

        Valid kwargs are Text properties:
        %(Text)s
        ACCEPTS: str
        N(   RW   R  Rx  R,   Ry  (   RJ   t   ylabelR(  R\   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   set_ylabeld  s
    c   	         s   h  d d <d d <  i  d <} | o" t i d | d | d |  } n t i d | d | d |  }   i |  | i |  | d j	 o | i |  n | i |    i i |    f d	   | _	 | i
 d
  o | i   i  n | S(   s0  
        TEXT(x, y, s, fontdict=None, **kwargs)

        Add text in string s to axis at location x,y (data coords)

          fontdict is a dictionary to override the default text properties.
          If fontdict is None, the defaults are determined by your rc
          parameters.

          withdash=True will create a TextWithDash instance instead
          of a Text instance.

        Individual keyword arguments can be used to override any given
        parameter

            text(x, y, s, fontsize=12)

        The default transform specifies that text is in data coords,
        alternatively, you can specify text in axis coords (0,0 lower left and
        1,1 upper right).  The example below places text in the center of the
        axes

            text(0.5, 0.5,'matplotlib',
                 horizontalalignment='center',
                 verticalalignment='center',
                 transform = ax.transAxes,
            )


       You can put a rectangular box around the text instance (eg to
       set a background color) by using the keyword bbox.  bbox is a
       dictionary of patches.Rectangle properties (see help
       for Rectangle for a list of these).  For example

         text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))

       Valid kwargs are Text properties
       %(Text)s
        R   R  R   R  t	   transformR%   RD   R   c            s     i  i |   S(    (   R"  R  (   R   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    t   clip_onN(   R   R*  t   TextWithDashR+  R  Ry  R,   R"  R"   R  R5   R-  R   (	   RJ   R%   RD   R  R(  t   withdashR\   Rz  t   t(    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   x  s"    )					$c         O   sj   t  i | |   } | i t i    |  i |  | i d  o | i |  i  n |  i	 i
 |  | S(   s   
        annotate(s, xy,
                 xytext=None,
                 xycoords='data',
                 textcoords='data',
                 arrowprops=None,
                 **props)

        %(Annotation)s
        R  (   R*  t
   AnnotationR  R   t   identity_transformR  R5   R-  R   R"  R"   (   RJ   R#   R\   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   annotate  s    $i    i   c         K   sL   t  i |  i |  i  } |  i | | g | | g d | d t | \ } | S(   s  
        AXHLINE(y=0, xmin=0, xmax=1, **kwargs)

        Axis Horizontal Line

        Draw a horizontal line at y from xmin to xmax.  With the default
        values of xmin=0 and xmax=1, this line will always span the horizontal
        extent of the axes, regardless of the xlim settings, even if you
        change them, eg with the xlim command.  That is, the horizontal extent
        is in axes coords: 0=left, 0.5=middle, 1.0=right but the y location is
        in data coordinates.

        Return value is the Line2D instance.  kwargs are the same as kwargs to
        plot, and can be used to control the line properties.  Eg

          # draw a thick red hline at y=0 that spans the xrange
          axhline(linewidth=4, color='r')

          # draw a default hline at y=1 that spans the xrange
          axhline(y=1)

          # draw a default hline at y=.5 that spans the the middle half of
          # the xrange
          axhline(y=.5, xmin=0.25, xmax=0.75)

        Valid kwargs are Line2D properties
        %(Line2D)s
        R  R  (   R   t   blend_xy_sep_transformR   R   RF   Ro   (   RJ   RD   R   R   R\   R  R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   axhline  s    0c         K   sL   t  i |  i |  i  } |  i | | g | | g d | d t | \ } | S(   s$  
        AXVLINE(x=0, ymin=0, ymax=1, **kwargs)

        Axis Vertical Line

        Draw a vertical line at x from ymin to ymax.  With the default values
        of ymin=0 and ymax=1, this line will always span the vertical extent
        of the axes, regardless of the xlim settings, even if you change them,
        eg with the xlim command.  That is, the vertical extent is in axes
        coords: 0=bottom, 0.5=middle, 1.0=top but the x location is in data
        coordinates.

        Return value is the Line2D instance.  kwargs are the same as
        kwargs to plot, and can be used to control the line properties.  Eg

            # draw a thick red vline at x=0 that spans the yrange
            l = axvline(linewidth=4, color='r')

            # draw a default vline at x=1 that spans the yrange
            l = axvline(x=1)

            # draw a default vline at x=.5 that spans the the middle half of
            # the yrange
            axvline(x=.5, ymin=0.25, ymax=0.75)

        Valid kwargs are Line2D properties
        %(Line2D)s
        R  R  (   R   R  R   R   RF   Ro   (   RJ   R%   R   R   R\   R  R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   axvline  s    0c   	      K   sr   t  i |  i |  i  } | | f | | f | | f | | f f } t i | |  } | i |  |  i |  | S(   s  
        AXHSPAN(ymin, ymax, xmin=0, xmax=1, **kwargs)

        Axis Horizontal Span.  ycoords are in data units and x
        coords are in axes (relative 0-1) units

        Draw a horizontal span (regtangle) from ymin to ymax.  With the
        default values of xmin=0 and xmax=1, this always span the xrange,
        regardless of the xlim settings, even if you change them, eg with the
        xlim command.  That is, the horizontal extent is in axes coords:
        0=left, 0.5=middle, 1.0=right but the y location is in data
        coordinates.

        kwargs are the kwargs to Patch, eg

          antialiased, aa
          linewidth,   lw
          edgecolor,   ec
          facecolor,   fc

        the terms on the right are aliases

        Return value is the patches.Polygon instance.

            #draws a gray rectangle from y=0.25-0.75 that spans the horizontal
            #extent of the axes
            axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)

        Valid kwargs are Polygon properties
        %(Polygon)s
        (   R   R  R   R   R   R   R  R  (	   RJ   R   R   R   R   R\   R  Rh  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   axhspan!	  s    !*c   	      K   sr   t  i |  i |  i  } | | f | | f | | f | | f g } t i | |  } | i |  |  i |  | S(   s   
        AXVSPAN(xmin, xmax, ymin=0, ymax=1, **kwargs)

        axvspan : Axis Vertical Span.  xcoords are in data units and y coords
        are in axes (relative 0-1) units

        Draw a vertical span (regtangle) from xmin to xmax.  With the default
        values of ymin=0 and ymax=1, this always span the yrange, regardless
        of the ylim settings, even if you change them, eg with the ylim
        command.  That is, the vertical extent is in axes coords: 0=bottom,
        0.5=middle, 1.0=top but the y location is in data coordinates.

        kwargs are the kwargs to Patch, eg

          antialiased, aa
          linewidth,   lw
          edgecolor,   ec
          facecolor,   fc

        the terms on the right are aliases

        return value is the patches.Polygon instance.

            # draw a vertical green translucent rectangle from x=1.25 to 1.55 that
            # spans the yrange of the axes
            axvspan(1.25, 1.55, facecolor='g', alpha=0.5)

        Valid kwargs are Polygon properties
        %(Polygon)s
        (   R   R  R   R   R   R   R  R  (	   RJ   R   R   R   R   R\   R  Rh  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   axvspanJ	  s     *RE   t   solidc      
   K   s  | i  d  d	 j	 o t d   n t |  p | g } n t |  p | g } n t |  p | g } n t i |  } t |  d j o  | t i | i | i	  } n t |  d j o  | t i | i | i	  } n t i |  } t i |  } t |  t |  j o t
 d  n t |  t |  j o t
 d  n g  } t | | |  D]( \ }	 }
 } | |	 | f |
 | f f qj~ } t i | d | d | d | } |  i |  | i |  t | i   | i    } t | i   | i    } | i   } | i   } |  i | | f  \ } } |  i | | f  \ } } | | f | | f f } |  i |  |  i   | S(
   s,  
        HLINES(y, xmin, xmax, colors='k', linestyle='solid', **kwargs)

        plot horizontal lines at each y from xmin to xmax.  xmin or xmax can
        be scalars or len(x) numpy arrays.  If they are scalars, then the
        respective values are constant, else the widths of the lines are
        determined by xmin and xmax

        colors is a line collections color args, either a single color
        or a len(x) list of colors

        linestyle is one of solid|dashed|dashdot|dotted

        Returns the LineCollection that was added
        R8   s^   hlines now uses a collections.LineCollection and not a list of Line2D to draw; see API_CHANGESi   s&   xmin and y are unequal sized sequencess&   xmax and y are unequal sized sequencesR   R9   R   N(   R   R,   R  R   Rm   Rp   R   t   onesRq   t   dtypeR0   R   t   mcollt   LineCollectionR  Ry  R  RL  R  R,  R  R  (   RJ   RD   R   R   R   R9   R   R\   R$   t   thisxmint   thisxmaxt   thisyRh  t   collR  R  R2  R3  t   corners(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   hliness	  sB      A
c      
   K   s  | i  d  d j	 o t d   n |  i d | d | d |  t |  p | g } n t |  p | g } n t |  p | g } n t i |  } t i |  } t i |  } t |  d j o  | t i | i	 | i
  } n t |  d j o  | t i | i	 | i
  } n t |  t |  j o t d  n t |  t |  j o t d  n t i | | g  i } g  }	 t | |  D]+ \ }
 \ } } |	 |
 | f |
 | f f q~	 } t i | d	 | d
 | d | } |  i |  | i |  | i   } | i   } t | i   | i    } t | i   | i    } |  i | | f  \ } } |  i | | f  \ } } | | f | | f f } |  i |  |  i   | S(   sp  
        VLINES(x, ymin, ymax, color='k')

        Plot vertical lines at each x from ymin to ymax.  ymin or ymax can be
        scalars or len(x) numpy arrays.  If they are scalars, then the
        respective values are constant, else the heights of the lines are
        determined by ymin and ymax


        colors is a line collections color args, either a single color
        or a len(x) list of colors

        linestyle is one of solid|dashed|dashdot|dotted

        Returns the collections.LineCollection that was added

        kwargs are collections.LineCollection properties:
        %(LineCollection)s
        R8   s^   vlines now uses a collections.LineCollection and not a list of Line2D to draw; see API_CHANGESR  R  R\   i   s&   ymin and x are unequal sized sequencess&   ymax and x are unequal sized sequencesR   R9   R   N(   R   R,   R  R  R   Rm   Rp   R   R  Rq   R  R0   R  t   TR   R  R  R  Ry  R  RL  R  R,  R  R  (   RJ   R%   R   R   R   R9   R   R\   t   YR$   t   thisxt   thisymint   thisymaxRh  R  R  R  R2  R3  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   vlines	  sF      A
c         O   s   | i  d t  } | i  d t  } |  i p |  i   n g  } x4 |  i | |   D]  } |  i |  | i |  qU W|  i d | d |  | S(   s  
        PLOT(*args, **kwargs)

        Plot lines and/or markers to the Axes.  *args is a variable length
        argument, allowing for multiple x,y pairs with an optional format
        string.  For example, each of the following is legal

            plot(x,y)            # plot x and y using the default line style and color
            plot(x,y, 'bo')      # plot x and y using blue circle markers
            plot(y)              # plot y using x as index array 0..N-1
            plot(y, 'r+')        # ditto, but with red plusses

        If x and/or y is 2-Dimensional, then the corresponding columns
        will be plotted.

        An arbitrary number of x, y, fmt groups can be specified, as in

        a.plot(x1, y1, 'g^', x2, y2, 'g-')

        Return value is a list of lines that were added.

        The following line styles are supported:

            -     : solid line
            --    : dashed line
            -.    : dash-dot line
            :     : dotted line
            .     : points
            ,     : pixels
            o     : circle symbols
            ^     : triangle up symbols
            v     : triangle down symbols
            <     : triangle left symbols
            >     : triangle right symbols
            s     : square symbols
            +     : plus symbols
            x     : cross symbols
            D     : diamond symbols
            d     : thin diamond symbols
            1     : tripod down symbols
            2     : tripod up symbols
            3     : tripod left symbols
            4     : tripod right symbols
            h     : hexagon symbols
            H     : rotated hexagon symbols
            p     : pentagon symbols
            |     : vertical line symbols
            _     : horizontal line symbols
            steps : use gnuplot style 'steps' # kwarg only

        The following color abbreviations are supported

            b  : blue
            g  : green
            r  : red
            c  : cyan
            m  : magenta
            y  : yellow
            k  : black
            w  : white

        In addition, you can specify colors in many weird and
        wonderful ways, including full names 'green', hex strings
        '#008000', RGB or RGBA tuples (0,1,0,1) or grayscale
        intensities as a string '0.8'.  Of these, the string
        specifications can be used in place of a fmt group, but the
        tuple forms can be used only as kwargs.

        Line styles and colors are combined in a single format string, as in
        'bo' for blue circles.

        The **kwargs can be used to set line properties (any property that has
        a set_* method).  You can use this to set a line label (for auto
        legends), linewidth, anitialising, marker face color, etc.  Here is an
        example:

            plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2)
            plot([1,2,3], [1,4,9], 'rs',  label='line 2')
            axis([0, 4, 0, 10])
            legend()

        If you make multiple lines with one plot command, the kwargs apply
        to all those lines, eg

            plot(x1, y1, x2, y2, antialised=False)

        Neither line will be antialiased.

        The kwargs are Line2D properties:
        %(Line2D)s

        kwargs scalex and scaley, if defined, are passed on
        to autoscale_view to determine whether the x and y axes are
        autoscaled; default True.  See Axes.autoscale_view for more
        information
        R  R  (   RX   Rs   R   R   R  R  R"   R  (   RJ   R#   R\   R  R  R   Rc   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRF   	  s    b t   boc   	      K   sn   |  i  p |  i   n |  i | | | |  } | o |  i |  n | o |  i |  n |  i   | S(   s  
        PLOT_DATE(x, y, fmt='bo', tz=None, xdate=True, ydate=False, **kwargs)

        Similar to the plot() command, except the x or y (or both) data
        is considered to be dates, and the axis is labeled accordingly.

        x or y (or both) can be a sequence of dates represented as
        float days since 0001-01-01 UTC.

        fmt is a plot format string.

        tz is the time zone to use in labelling dates.  Defaults to rc value.

        If xdate is True, the x-axis will be labeled with dates.

        If ydate is True, the y-axis will be labeled with dates.

        Note if you are using custom date tickers and formatters, it
        may be necessary to set the formatters/locators after the call
        to plot_date since plot_date will set the default tick locator
        to ticker.AutoDateLocator (if the tick locator is not already set to
        a ticker.DateLocator instance) and the default tick formatter to
        AutoDateFormatter (if the tick formatter is not already set to
        a DateFormatter instance).

        Valid kwargs are Line2D properties:
        %(Line2D)s


        See dates for helper functions date2num, num2date
        and drange for help on creating the required floating point dates
        (   R   R   RF   RE  RF  R  (	   RJ   R%   RD   R8   RC  t   xdatet   ydateR\   R]   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   plot_dateh
  s    #
c         O   s   |  i  p |  i   n h  | i d d  d <| i d d  d <} h  | i d d  d <| i d d  d <} |  i d |  |  i d |  |  i  } t |  _  |  i | |   } | |  _  | S(   s~  
        LOGLOG(*args, **kwargs)

        Make a loglog plot with log scaling on the a and y axis.  The args
        to semilog x are the same as the args to plot.  See help plot for
        more info.

        Optional keyword args supported are any of the kwargs
        supported by plot or set_xscale or set_yscale.  Notable, for
        log scaling:

          * basex: base of the x logarithm

          * subsx: the location of the minor ticks; None defaults to
            autosubs, which depend on the number of decades in the
            plot; see set_xscale for details

          * basey: base of the y logarithm

          * subsy: the location of the minor yticks; None defaults to
            autosubs, which depend on the number of decades in the
            plot; see set_yscale for details

        The remaining valid kwargs are Line2D properties:
        %(Line2D)s
        R  i
   R  R0  R1  R   N(   R   R   RX   R,   R  R  Rs   RF   (   RJ   R#   R\   t   dxt   dyR@   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   loglog
  s    			c         O   s   |  i  p |  i   n h  | i d d  d <| i d d  d <} |  i d |  |  i  } t |  _  |  i | |   } | |  _  | S(   s  
        SEMILOGX(*args, **kwargs)

        Make a semilog plot with log scaling on the x axis.  The args to
        semilog x are the same as the args to plot.  See help plot for more
        info.

        Optional keyword args supported are any of the kwargs supported by
        plot or set_xscale.  Notable, for log scaling:

            * basex: base of the logarithm

            * subsx: the location of the minor ticks; None defaults to
              autosubs, which depend on the number of decades in the
              plot; see set_xscale for details

        The remaining valid kwargs are Line2D properties:
        %(Line2D)s
        R  i
   R  R   N(   R   R   RX   R,   R  Rs   RF   (   RJ   R#   R\   t   dR@   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   semilogx
  s    			c         O   s   |  i  p |  i   n h  | i d d  d <| i d d  d <} |  i d |  |  i  } t |  _  |  i | |   } | |  _  | S(   s  
        SEMILOGY(*args, **kwargs):

        Make a semilog plot with log scaling on the y axis.  The args to
        semilogy are the same as the args to plot.  See help plot for more
        info.

        Optional keyword args supported are any of the kwargs supported by
        plot or set_yscale.  Notable, for log scaling:

            * basey: base of the logarithm

            * subsy: a sequence of the location of the minor ticks;
              None defaults to autosubs, which depend on the number of
              decades in the plot; see set_yscale for details

        The remaining valid kwargs are Line2D properties:
        %(Line2D)s

        R0  i
   R1  R   N(   R   R   RX   R,   R  Rs   RF   (   RJ   R#   R\   R  R@   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   semilogy
  s    			c         K   s   |  i  | | |  S(   s  
        ACORR(x, normed=False, detrend=mlab.detrend_none, usevlines=False,
              maxlags=None, **kwargs)
        Plot the autocorrelation of x.  If normed=True, normalize the
        data but the autocorrelation at 0-th lag.  x is detrended by
        the detrend callable (default no normalization.

        data are plotted as plot(lags, c, **kwargs)

        return value is lags, c, line where lags are a length
        2*maxlags+1 lag vector, c is the 2*maxlags+1 auto correlation
        vector, and line is a Line2D instance returned by plot.  The
        default linestyle is None and the default marker is 'o',
        though these can be overridden with keyword args.  The cross
        correlation is performed with numpy correlate with
        mode=2.

        If usevlines is True, Axes.vlines rather than Axes.plot is used
        to draw vertical lines from the origin to the acorr.
        Otherwise the plotstyle is determined by the kwargs, which are
        Line2D properties.  If usevlines, the return value is lags, c,
        linecol, b where linecol is the collections.LineCollection and b is the x-axis

        if usevlines=True, kwargs are passed onto Axes.vlines
        if usevlines=False, kwargs are passed onto Axes.plot

        maxlags is a positive integer detailing the number of lags to show.
        The default value of None will return all (2*len(x)-1) lags.

        See the respective function for documentation on valid kwargs
        (   t   xcorr(   RJ   R%   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   acorr  s     c         K   s  t  |  } | t  |  j o t d   n | t i |   } | t i |   } t i | | d d }	 | o3 |	 t i t i | |  t i | |   }	 n | d j o | d } n | | j p | d j  o t d |   n t i | | d  }
 |	 | d | | | !}	 | o. |  i	 |
 d g |	 |  } |  i
 |   } n? | i d d  | i d	 d
  |  i |
 |	 |  \ } d } |
 |	 | | f S(   s  
        XCORR(x, y, normed=False, detrend=mlab.detrend_none, usevlines=False, **kwargs):

        Plot the cross correlation between x and y.  If normed=True,
        normalize the data but the cross correlation at 0-th lag.  x
        and y are detrended by the detrend callable (default no
        normalization.  x and y must be equal length

        data are plotted as plot(lags, c, **kwargs)

        return value is lags, c, line where lags are a length
        2*maxlags+1 lag vector, c is the 2*maxlags+1 auto correlation
        vector, and line is a Line2D instance returned by plot.  The
        default linestyle is None and the default marker is 'o',
        though these can be overridden with keyword args.  The cross
        correlation is performed with numpy correlate with
        mode=2.

        If usevlines is True, Axes.vlines rather than Axes.plot is used
        to draw vertical lines from the origin to the acorr.
        Otherwise the plotstyle is determined by the kwargs, which are
        Line2D properties.  If usevlines, the return value is lags, c,
        linecol, b where linecol is the collections.LineCollection and b is the x-axis

        if usevlines=True, kwargs are passed onto Axes.vlines
        if usevlines=False, kwargs are passed onto Axes.plot

        maxlags is a positive integer detailing the number of lags to show.
        The default value of None will return all (2*len(x)-1) lags.

        See the respective function for documentation on valid kwargs
        s   x and y must be equal lengtht   modei   i   s.   maglags must be None or strictly positive < %di    R:   t   oR9   R,   N(   R   R0   Rm   Rp   t	   correlateR^  t   dotR,   Rn   R  R  t
   setdefaultRF   (   RJ   R%   RD   t   normedt   detrendt	   usevlinest   maxlagsR\   t   NxR<   t   lagsR  R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  /  s(    #:c            s    f d   } t  |  d j o g  } g  } xf |   D][ } | i   } | d j	 o< | d j o/ | i d  o | i |  | i |  q8 q8 Wt  |  d j o t i d  d Sqn&t  |  d j oA | d } g  } t |   |  D] \ }	 } | |	 q ~ } n t  |  d j o t | d  p t	 | d t
  oM | \ } }
 g  } t |   |  D] \ }	 } | |	 qr~ } |
 | d <q| \ } } n= t  |  d	 j o | \ } } }
 |
 | d <n t d
   t i |  } t i   | | |    _   i S(   s	  
        LEGEND(*args, **kwargs)

        Place a legend on the current axes at location loc.  Labels are a
        sequence of strings and loc can be a string or an integer specifying
        the legend location

        USAGE:

          Make a legend with existing lines

          >>> legend()

          legend by itself will try and build a legend using the label
          property of the lines/patches/collections.  You can set the label of
          a line by doing plot(x, y, label='my data') or line.set_label('my
          data'). If label is set to '_nolegend_', the item will not be shown
          in legend.

            # automatically generate the legend from labels
            legend( ('label1', 'label2', 'label3') )

            # Make a legend for a list of lines and labels
            legend( (line1, line2, line3), ('label1', 'label2', 'label3') )

            # Make a legend at a given location, using a location argument
            # legend( LABELS, LOC )  or
            # legend( LINES, LABELS, LOC )
            legend( ('label1', 'label2', 'label3'), loc='upper left')
            legend( (line1, line2, line3),  ('label1', 'label2', 'label3'), loc=2)

        The location codes are

          'best'         : 0,
          'upper right'  : 1,
          'upper left'   : 2,
          'lower left'   : 3,
          'lower right'  : 4,
          'right'        : 5,
          'center left'  : 6,
          'center right' : 7,
          'lower center' : 8,
          'upper center' : 9,
          'center'       : 10,

        If none of these are suitable, loc can be a 2-tuple giving x,y
        in axes coords, ie,

          loc = 0, 1 is left top
          loc = 0.5, 0.5 is center, center

        and so on.  The following kwargs are supported:

        isaxes=True           # whether this is an axes legend
        numpoints = 4         # the number of points in the legend line
        prop = FontProperties(size='smaller')  # the font property
        pad = 0.2             # the fractional whitespace inside the legend border
        markerscale = 0.6     # the relative size of legend markers vs. original
        shadow                # if True, draw a shadow behind legend
        labelsep = 0.005     # the vertical space between the legend entries
        handlelen = 0.05     # the length of the legend lines
        handletextsep = 0.02 # the space between the legend line and legend text
        axespad = 0.02       # the border between the axes and legend edge
        c       	      s     i  }  |  i   i  |  i g  }   i D]$ } t | t i  o | | q. q. ~  |  i g  }   i D]$ } t | t i  o | | qp qp ~  |  S(   N(   R   R  R   R   R<  R  R  t   RegularPolyCollection(   t   handlesR$   R<   R  (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_handles  s    
((i    R*   t   _sD   No labeled objects found. Use label='...' kwarg on individual plots.i   i   t   loci   s   Invalid arguments to legendN(   R   R  R,   t
   startswithR"   RR  RS  R   R   R<  RR   Ra   R   t   flattent   mlegendt   LegendR&  (   RJ   R#   R\   R  R  R'  t   handleR   R$   R   R  R  (    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   r  s:    B	
 +
7%3c      
   O   s  | i  d d  } t i |  p t i | g d t i } n t i |  p t i | g d t i } n | d j o t i d t |  d f t i  } t i d t |  d f t i  } | | d  | d d d  <| d d d  <| | d | d d d  <| d d d  <n| d	 j o t i d t |  d f t i  } t i d t |  d f t i  } | | d | d d d  <| d d d  <| | d  | d d d  <| d d d  <n | d
 j o t i d t |  f t i  } t i d t |  f t i  } d | d  | d | d d d  <d | d  | d | d d d  <| d | d | d <| d <| | | d d d  <| d d d  <n |  i	 | | | |  S(   s  
        step(x, y, *args, **kwargs)

        x and y must be 1-D sequences, and it is assumed, but not checked,
        that x is uniformly increasing.

        Make a step plot. The args and keyword args to step are the same
        as the args to plot. See help plot for more info.

        Additional keyword args for step:

        * where: can be 'pre', 'post' or 'mid'; if 'pre', the
                    interval from x[i] to x[i+1] has level y[i];
                    if 'post', that interval has level y[i+1];
                    and if 'mid', the jumps in y occur half-way
                    between the x-values.  Default is 'pre'.
        t   wheret   preR  i   i   ii    Nt   postt   midg      ?(
   RX   R   R   R   R  Rm   t   float_t   zerosR   RF   (   RJ   R%   RD   R#   R\   R  Ra  Rb  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   step  s.    &&+/&&+/""##+g?i   t   edget   verticalc   .      K   s  |  i  p |  i   n d   } | } | |  } | |  } | |  } | } | |  } | |  } t } t } | d j o |  i d | d | d |  | o |  i d  n | d' j o3 |  i   d j o d g } t } q d g } n t |  } t |  d	 j o | | 9} n t |  d	 j o | | 9} q(n | d
 j o |  i d | d | d |  | o |  i	 d  n | d' j o3 |  i
   d j o d g } t } qd g } n t |  } t |  d	 j o | | 9} n t |  d	 j o | | 9} q(n t d |  t |  d	 j o | | } n t |  p; t |  o  t |  d j o | d j p t |  o | g | } n t |  p; t |  o  t |  d j o | d j p t |  o | g | } n | d' j	 o" t |  p | g | } q*n |	 d' j	 o" t |	  p |	 g | }	 qYn t |  | j p t d |  t |  | j p t d |  t |  | j p t d |  t |  | j p t d |  t |  | j p t d |  t |  | j p t d |  t |  | j p t d |  | d' j	 o' t |  | j o t d |   n |	 d' j	 o' t |	  | j o t d |   n g  } | d j o n | d j o | d j oA g  } t t |   D] } | | | | | d q~ } qy| d
 j oA g  } t t |   D] } | | | | | d q>~ } qyn t d |  t | | | | | | |  } x | D] \ } } } } } }  }! | d j  o | | 7} t |  } n | d j  o | | 7} t |  } n t i d | | f d | d | d | d |  d |!  }" |" i |  |  i |"  | i |"  qW|  i  }# |  i t  |	 d' j	 p | d' j	 o,| d j op g  }$ t | |  D] \ } } |$ | d  | q~$ }% g  }& t | |  D] \ } } |& | | q~& }' n~ | d
 j op g  }( t | |  D] \ } } |( | | q6~( }% g  }) t | |  D] \ } } |) | d  | qj~) }' n |  i |% |' d! | d" |	 d# d' d$ |
 d% | n |  i |#  | o~ |  i i   i   \ }* }+ t i |  }* |	 d' j	 o |* t i |	  }* n t |* d& d  }* |  i i   i  |* |+  n | o~ |  i i!   i   \ }, }- t i |  }, | d' j	 o |, t i |  }, n t |, d& d  }, |  i i!   i  |, |-  n |  i"   | S((   se  
        BAR(left, height, width=0.8, bottom=0,
            color=None, edgecolor=None, linewidth=None,
            yerr=None, xerr=None, ecolor=None, capsize=3,
            align='edge', orientation='vertical', log=False)

        Make a bar plot with rectangles bounded by

          left, left+width, bottom, bottom+height
                (left, right, bottom and top edges)

        left, height, width, and bottom can be either scalars or sequences

        Return value is a list of Rectangle patch instances

            left - the x coordinates of the left sides of the bars

            height - the heights of the bars

        Optional arguments:

            width - the widths of the bars

            bottom - the y coordinates of the bottom edges of the bars

            color - the colors of the bars

            edgecolor - the colors of the bar edges

            linewidth - width of bar edges; None means use default
                linewidth; 0 means don't draw edges.

            xerr and yerr, if not None, will be used to generate errorbars
            on the bar chart

            ecolor specifies the color of any errorbar

            capsize (default 3) determines the length in points of the error
            bar caps

            align = 'edge' (default) | 'center'

            orientation = 'vertical' | 'horizontal'

            log = False | True - False (default) leaves the orientation
                    axis as-is; True sets it to log scale

        For vertical bars, align='edge' aligns bars by their left edges in
        left, while 'center' interprets these values as the x coordinates of
        the bar centers. For horizontal bars, 'edge' aligns bars by their
        bottom edges in bottom, while 'center' interprets these values as the
        y coordinates of the bar centers.

        The optional arguments color, edgecolor, linewidth, xerr, and yerr can
        be either scalars or sequences of length equal to the number of bars.
        This enables you to use bar as the basis for stacked bar charts, or
        candlestick plots.

        Optional kwargs:
        %(Rectangle)s
        c         S   s    t  |   p |  g Sn |  Sd  S(   N(   R   (   R%   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   make_iterablea  s    R  R  R  R\   R   g0.++i    i   t
   horizontals   invalid orientation: %si   s$   argument 'left' must be %d or scalars&   argument 'height' must be %d or scalars%   argument 'width' must be %d or scalars&   argument 'bottom' must be %d or scalars%   argument 'color' must be %d or scalars)   argument 'edgecolor' must be %d or scalars)   argument 'linewidth' must be %d or scalars/   bar() argument 'yerr' must be len(%s) or scalars/   bar() argument 'xerr' must be len(%s) or scalarR  R  g       @s   invalid alignment: %sR  R  R  R   R  R  g      ?t   yerrt   xerrR8   t   ecolort   capsizeg?N(#   R   R   Ro   R  R  R,   R/  Rs   R   R  R  R0   R   R   R_   R   R   RQ  R   R.  Ry  R  R"   R7  t   errorbarR   R  R  Rm   t   amint   amaxRL  R  R  R  (.   RJ   R   R  R  R   R;   R  R  R  R  R  R  t   alignt   orientationR   R\   R  t   _leftt   _bottomt   adjust_ylimt   adjust_xlimt   nbarsR   R$   R  R  R#   R   R@   R   R   R<   t   eRT  RB   t	   holdstateRt  R%   t   _[4]RD   t   _[5]t   _[6]R   R   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   bar  s    C		
	
	!--!!!!!!!  AE 

			884<	
c         K   s1   |  i  d | d | d | d | d d |  } | S(   s  
        BARH(bottom, width, height=0.8, left=0, **kwargs)

        Make a horizontal bar plot with rectangles bounded by

          left, left+width, bottom, bottom+height
                (left, right, bottom and top edges)

        bottom, width, height, and left can be either scalars or sequences

        Return value is a list of Rectangle patch instances

            bottom - the vertical positions of the bottom edges of the bars

            width - the lengths of the bars

        Optional arguments:

            height - the heights (thicknesses) of the bars

            left - the x coordinates of the left edges of the bars

            color - the colors of the bars

            edgecolor - the colors of the bar edges

            linewidth - width of bar edges; None means use default
                linewidth; 0 means don't draw edges.

            xerr and yerr, if not None, will be used to generate errorbars
            on the bar chart

            ecolor specifies the color of any errorbar

            capsize (default 3) determines the length in points of the error
            bar caps

            align = 'edge' (default) | 'center'

            log = False | True - False (default) leaves the horizontal
                    axis as-is; True sets it to log scale

        Setting align='edge' aligns bars by their bottom edges in bottom,
        while 'center' interprets these values as the y coordinates of the bar
        centers.

        The optional arguments color, edgecolor, linewidth, xerr, and yerr can
        be either scalars or sequences of length equal to the number of bars.
        This enables you to use barh as the basis for stacked bar charts, or
        candlestick plots.

        Optional kwargs:
        %(Rectangle)s
        R   R  R  R   R  R  (   R  (   RJ   R   R  R  R   R\   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   barh  s    8!c         K   s6   t  i | | |  } |  i | d t |  i   | S(   s  
        A collection of horizontal bars spanning yrange with a sequence of
        xranges

        xranges : sequence of (xmin, xwidth)
        yrange  : (ymin, ywidth)

        kwargs are collections.BrokenBarHCollection properties
        %(BrokenBarHCollection)s

        these can either be a single argument, ie facecolors='black'
        or a sequence of arguments for the various bars, ie
        facecolors='black', 'red', 'green'

        R  (   R  t   BrokenBarHCollectionR  Rs   R  (   RJ   t   xrangest   yrangeR\   t   col(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   broken_barhF  s    
s   b-s   r-c         C   s   |  i  } |  i  p |  i   n |  i t  |  i | | |  \ } g  } xN t | |  D]= \ }	 }
 |  i |	 |	 g d |
 g |  \ } | i |  q\ W|  i t i |  t i	 |  g d d g |  \ } |  i |  | | | f S(   s  
        STEM(x, y, linefmt='b-', markerfmt='bo', basefmt='r-')

        A stem plot plots vertical lines (using linefmt) at each x location
        from the baseline to y, and places a marker there using markerfmt.  A
        horizontal line at 0 is is plotted using basefmt

        Return value is (markerline, stemlines, baseline) .

        See
        http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html
        for details and examples/stem_plot.py for a demo.
        i    (
   R   R   R7  Rs   RF   R   R"   Rm   R  R  (   RJ   R%   RD   t   linefmtt	   markerfmtt   basefmtt   remember_holdt
   markerlinet	   stemlinesR  R  R   t   baseline(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   stem^  s    	 $6g333333?g?c	         C   s  |  i  t  t i |  i t i  } t | i    }	 |	 d j o t i | |	  } n | d j o d g t
 |  } n | d j o d g t
 |  } n t
 |  t
 |  j p t  t
 |  t
 |  j p t  | d j o
 d } n d }
 d } d } d } g  } g  } g  } xgt i | | |  D]P\ } } } |
 \ } } | | } d t i d | | } | | t i |  7} | | t i |  7} t i | | f | d | d | d | | t
 |  } | i |  |  i |  | i |  | o= t i | d d  } | i d | i    |  i |  n | | | t i |  } | | | t i |  } |  i | | | d t d d d d d } | i |  | d j	 o | | | t i |  } | | | t i |  } t |  o | d | } n. t |  o | d |  } n t d   |  i | | | d d d d } | i |  n | } | d 7} q<W|  i d  |  i  d  |  i! g   |  i" g   | d j o | | f Sn | | | f Sd S(    so  
        PIE(x, explode=None, labels=None,
            colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
            autopct=None, pctdistance=0.6, labeldistance=1.1, shadow=False)

        Make a pie chart of array x.  The fractional area of each wedge is
        given by x/sum(x).  If sum(x)<=1, then the values of x give the
        fractional area directly and the array will not be normalized.

          - explode, if not None, is a len(x) array which specifies the
            fraction of the radius to offset that wedge.

          - colors is a sequence of matplotlib color args that the pie chart
            will cycle.

          - labels, if not None, is a len(x) list of labels.

          - autopct, if not None, is a string or function used to label the
            wedges with their numeric value.  The label will be placed inside
            the wedge.  If it is a format string, the label will be fmt%pct.
            If it is a function, it will be called

          - pctdistance is the ratio between the center of each pie slice
            and the start of the text generated by autopct.  Ignored if autopct
            is None; default is 0.6.

          - labeldistance is the radial distance at which the pie labels are drawn

          - shadow, if True, will draw a shadow beneath the pie.

        The pie chart will probably look best if the figure and axes are
        square.  Eg,

          figure(figsize=(8,8))
          ax = axes([0.1, 0.1, 0.8, 0.8])

        Return value:

          If autopct is None, return a list of (patches, texts), where patches
          is a sequence of mpatches.Wedge instances and texts is a
          list of the label Text instnaces

          If autopct is not None, return (patches, texts, autotexts), where
          patches and texts are as above, and autotexts is a list of text
          instances for the numeric labels
        i   R*   i    R@   RA   RB   R<   RC   RD   RE   R   i   g      ?g     v@R   g{Gzg?R  s   xtick.labelsizeR  R  R  g      Y@s+   autopct must be callable or a format stringg      g      ?N(   R@   RA   RB   R<   RC   RD   RE   R   (   i    i    (   g      g      ?(   g      g      ?(#   R  Ro   Rm   Rp   t   astypet   float32R<  t   sumt   divideR,   R   R_   R   t   safezipRM  t   pit   cost   sinR   t   WedgeR"   R  R   t   ShadowR2  t
   get_zorderR   R7   R   RY  Ra   R   R   R  R5  (   RJ   R%   t   explodeR'  R   t   autopctt   pctdistancet   shadowt   labeldistancet   sxR  t   radiust   theta1R  R"  t   slicest	   autotextst   fracR   t   explRD   t   theta2t   thetamR   t   shadRi  Rj  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   pie~  sv    5#$$   
#
		t   -c   ,      K   s>	  |  i  d | d | d |  |  i p |  i   n t |  p | g } n t |  p | g } n | d j	 o( t |  p | g t |  } q n | d j	 o( t |  p | g t |  } q n d } | o, | d j	 o |  i | | | |  \ } n g  } g  } h  d d <} d | j o | d | d <n d | j o | d | d <n t |	  p# t i |	 g t |  t	  }	 n t i |	 t	  }	 t |
  p# t i
 |
 g t |  t	  }
 n t i |
 t	  }
 t |  p# t i
 | g t |  t	  } n t i | t	  } t |  p# t i
 | g t |  t	  } n t i | t	  } d   } | d	 j o^ h  d
 | d <d d <} d | j o | d | d <n d | j o | d | d <qn | d j	 ot |  o t |  d
 j o t | d	  o t | d  oz g  } t i | | d	  D] \ } } | | | qJ~ } g  } t i | | d  D] \ } } | | | q~ } no g  } t i | |  D] \ } } | | | q~ } g  } t i | |  D] \ } } | | | q~ } | i |  i | | | |   | d	 j of| i   o | | | |  \ } } | i |  i | | d d d t i |  | } | | | |  \ } } | i |  i | | d |   n  | i |  i | | d |   | i   o | | | |  \ } } | i |  i | | d d d t i |  | } | | | |  \ } } | i |  i | | d |   q| i |  i | | d |   qn | d j	 ot |  o t |  d
 j o t | d	  o t | d  oz g  }  t i | | d	  D] \ }! } |  |! | q~  }" g  }# t i | | d  D] \ }! } |# |! | qR~# }$ no g  }% t i | |  D] \ }! } |% |! | q~% }" g  }& t i | |  D] \ }! } |& |! | q~& }$ | i |  i | |" |$ |   | d	 j of|	 i   o | | |" |	  \ }' }( | i |  i |' |( d d d t i |  |	 }	 | | |" |	  \ }' }( | i |  i |' |( d |   n  | i |  i | |" d |   |
 i   o | | |$ |
  \ }) }* | i |  i |) |* d d d t i |  |
 }
 | | |$ |
  \ }) }* | i |  i |) |* d |   qv| i |  i | |$ d |   qzn | o, | d j	 o |  i | | | |  \ } n | d j o0 | d j o |  i i   } q| i   } n x | D] }+ |+ i |  qWx | D] }+ |+ i |  q	W|  i   | | | f S(   s	  
        ERRORBAR(x, y, yerr=None, xerr=None,
                 fmt='b-', ecolor=None, capsize=3, barsabove=False,
                 lolims=False, uplims=False,
                 xlolims=False, xuplims=False)

        Plot x versus y with error deltas in yerr and xerr.
        Vertical errorbars are plotted if yerr is not None
        Horizontal errorbars are plotted if xerr is not None

        xerr and yerr may be any of:

            a rank-0, Nx1 Numpy array  - symmetric errorbars +/- value

            an N-element list or tuple - symmetric errorbars +/- value

            a rank-1, Nx2 Numpy array  - asymmetric errorbars -column1/+column2

        Alternatively, x, y, xerr, and yerr can all be scalars, which
        plots a single error bar at x, y.

            fmt is the plot format symbol for y.  if fmt is None, just
            plot the errorbars with no line symbols.  This can be useful
            for creating a bar plot with errorbars

            ecolor is a matplotlib color arg which gives the color the
            errorbar lines; if None, use the marker color.

            capsize is the size of the error bar caps in points

            barsabove, if True, will plot the errorbars above the plot symbols
            - default is below

            lolims, uplims, xlolims, xuplims: These arguments can be used
             to indicate that a value gives only upper/lower limits. In
             that case a caret symbol is used to indicate this. lims-arguments
             may be of the same type as xerr and yerr.

            kwargs are passed on to the plot command for the markers.
              So you can add additional key=value pairs to control the
              errorbar markers.  For example, this code makes big red
              squares with thick green edges

              >>> x,y,yerr = rand(3,10)
              >>> errorbar(x, y, yerr, marker='s',
                           mfc='red', mec='green', ms=20, mew=4)

             mfc, mec, ms and mew are aliases for the longer property
             names, markerfacecolor, markeredgecolor, markersize and
             markeredgewith.

        valid kwargs for the marker properties are
        %(Line2D)s

        Return value is a length 3 tuple.  The first element is the
        Line2D instance for the y symbol lines.  The second element is
        a list of error bar cap lines, the third element is a list of
        line collections for the horizontal and vertical error ranges
        R  R  R\   t
   _nolegend_R   R  RT  c         S   s   t  |   t  |  j p t  t  |   t  |  j p t  g  } t |  |  D] \ } } | o | | qT qT ~ }  g  } t | |  D] \ } } | o | | q q ~ } |  | f S(   so   
            return xs[mask], ys[mask] where mask is True but xs and
            ys are not arrays
            (   R   R_   R   (   RJ  RK  R   R$   R  R@   R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   xywherev  s
      ;;i    i   t   mst   markeredgewidtht   mewi   t   lsR,   R:   s   k|t   k_N(   R  R   R   R   R,   R   RF   Rm   Rp   t   boolR  R   R  R"   R  t   anyR  R3   t	   CARETLEFTt
   CARETRIGHTR  t	   CARETDOWNt   CARETUPR  RS   t	   get_colort	   set_colorR  (,   RJ   R%   RD   R  R  R8   R  R  t	   barsabovet   lolimst   uplimst   xlolimst   xuplimsR\   t   l0t   barcolst   caplinest   lines_kwR	  t   plot_kwR$   R  t   thiserrR   R  R   Rt  R  t   leftlot   ylot   rightupt   yupR  R  R{  R  R  t   _[7]t   _[8]t   xlot   lowerlot   xupt   upperupR   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    @#000	B;?77+#+#'B;?77+#+#'  
s   b+g      ?c   3         s    i  p   i   n   i  } g  g  g  g  g  f \ }	 }
 } } } t | d  o t | i  d j o1 t | d d  o t |  } q?| g } qCt | i  d j o | i \ } } | d j o | g } q?| d j o | i   g } q?g  } t |  D] } | | d d  | f q~ } qCt d  n t | d d  p | g } n t |  } | d j o t d | d  } n | d j o6 t
 |  t |  } t d t
 | d	  d
  } n t | t  p t | t  o t i | f t  | } n   i t  xt |  D]\ } } t i | |  } t |  } t i | d d d g  \ } } } | | } | | | } t i | | j |  } t |  d j o
 | } n t
 |  } | | | } t i | | j |  } t |  d j o
 | } n t |  } g  } g  }  g  }! g  }" t |  d j oh t i | | j |  } t i | | j  |  }  t i | i d  | }! t i |  i d  | }" n | | | d
 }# | | | d
 }$ t i d  | }% | | | d }& | | | d }' |& |' g }( | | g }) | d j o: |# |$ |$ |# |# g }* | | | | | g }+ |# |$ g }, n | d | t i |  }- | d | t i |  }. |- | j o
 | }- n |. | j  o
 | }. n |# |$ |$ |' |$ |$ |# |# |& |# |# g }* | | |. | |- | | |- | |. | g }+ |& |' g }, | | g }) | o   f d   }/ n   f d   }/ |	 i |/ |% | | g d |% | | g d   |
 i |/ |( | | g d |( | | g d   | i |/ |* |+ d   | i |/ |, |) d   | i |/ |! | | |" |  |   q.Wd | j o   i   i }0 }1 n   i   i }0 }1 t |  d
 t
 |  d
 f }2 |1 |2  |0 |    i |  t d |	 d |
 d | d | d |  S(   s  
        boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
                positions=None, widths=None)

        Make a box and whisker plot for each column of x or
        each vector in sequence x.
        The box extends from the lower to upper quartile values
        of the data, with a line at the median.  The whiskers
        extend from the box to show the range of the data.  Flier
        points are those past the end of the whiskers.

        notch = 0 (default) produces a rectangular box plot.
        notch = 1 will produce a notched box plot

        sym (default 'b+') is the default symbol for flier points.
        Enter an empty string ('') if you don't want to show fliers.

        vert = 1 (default) makes the boxes vertical.
        vert = 0 makes horizontal boxes.  This seems goofy, but
        that's how Matlab did it.

        whis (default 1.5) defines the length of the whiskers as
        a function of the inner quartile range.  They extend to the
        most extreme data point within ( whis*(75%-25%) ) data range.

        positions (default 1,2,...,n) sets the horizontal positions of
        the boxes. The ticks and limits are automatically set to match
        the positions.

        widths is either a scalar or a vector and sets the width of
        each box. The default is 0.5, or 0.15*(distance between extreme
        positions) if that is smaller.

        x is an array or a sequence of vectors.

        Returns a list of the lines added.

        Rq   i   i    i   Ns*   input x can have no more than 2 dimensionst   __len__g333333?g      ?g      ?i   i2   iK   g      ?gQ?c             s     i  |    S(   N(   RF   (   R#   (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   doplotr  s    c             s`   g  } xJ t  d t |   d  D]0 } | i |  | d |  | |  | d g  q W  i |   S(   Ni    i   i   i   (   R   R   R  RF   (   R#   t   shuffledR  (   RJ   (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR-  u  s
     .s   b--s   k-s   b-s   r-t   whiskerst   capst   boxest   medianst   fliers(   R   R   R   R   Rq   t   listt   ravelR   R0   R,   RL  R  R<  R<  RR   Rm   R  R7  Rs   R  R   t   prctilet   compressR^  R  R  R   R5  R   Rq  (3   RJ   R%   t   notcht   symt   vertt   whist	   positionst   widthst
   holdStatusR/  R0  R1  R2  R3  Rt   Ru   R$   R  R  t   distanceR  R  t   rowt   q1t   medt   q3t   iqt   hi_valt   wisk_hit   lo_valt   wisk_lot   flier_hit   flier_lot
   flier_hi_xt
   flier_lo_xt	   box_x_mint	   box_x_maxt   wisk_xt	   cap_x_mint	   cap_x_maxt   cap_xt   med_yt   box_xt   box_yt   med_xt	   notch_maxt	   notch_minR-  t   settickst   setlimt	   newlimits(    (   RJ   s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   boxplot  s    (	$;   $




	 

i   R@   R  g      ?c   &      K   s,  |  i  p |  i   n h  d t i d d f d <d' d <d( d <d t i d	 d f d
 <d t i d f d <d d t i d	 d f d <d) d <d* d <d+ d <d, d <d- d <d t i d d f d <} |  i d | d | d |  t | | | |  \ } } } } t |  p\ t i |  } t	 |  d j o! | d t	 |  j o
 d$ } qt i i | |
  } n t i i | |
  } t |  p | f } n | } | o
 d$ } n d } d$ } d } | d$ j o# | d$ j	 o | d f } d$ } n t |  oP | i |  } | d$ j o | d$ j o t d   n | | \ } } } n t |  o t	 |  d j  p t	 |  d j o t d   n t i | d  o} t	 |  d j o | d d } } n- t	 |  d j o | d | d } } n t } | d d. j o | d } qLqPt i | d  } n | d$ j	 o| d j oL t i |  i i | | | d | d  | d! | d" t | |  d# |  i } q| d j oL t i |  i i | | | d | d  | d! | d" t | |  d# |  i } q| d j oL t i |  i i | | | d | d  | d! | d" t | |  d# |  i } qnt i t | d$ d$  d f d | d$ d$  d f d   } | | } t i |  } t i | |  i i i   d%  } t	 |  d j o | d | g } n& g  } | D] } | | | q~ } t i | d | d  | d! | d" t | |  d# |  i } | i  t! i"    | i# |
  | i$ |  | d$ j o | d$ j	 o t% | t i&  p t'  n | d$ j	 o t% | t i(  p t'  n | i) t i |   | i* |  | i+ |  | d$ j	 p |	 d$ j	 o | i, | |	  qk| i-   n | } | } t i. |  } t i/ |  } t i. |  } t i/ |  }  | | }! |  | }" d& |! d& |" }# }$ | |# | |$ f | |# |  |$ f f }% |  i0 |%  |  i1   |  i2 |  | S(/   sc  
        SCATTER(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
            vmin=None, vmax=None, alpha=1.0, linewidths=None,
            faceted=True, **kwargs)
        Supported function signatures:

            SCATTER(x, y, **kwargs)
            SCATTER(x, y, s, **kwargs)
            SCATTER(x, y, s, c, **kwargs)

        Make a scatter plot of x versus y, where x, y are 1-D sequences
        of the same length, N.

        Arguments s and c can also be given as kwargs; this is encouraged
        for readability.

            s is a size in points^2.  It is a scalar
              or an array of the same length as x and y.

            c is a color and can be a single color format string,
              or a sequence of color specifications of length N,
              or a sequence of N numbers to be mapped to colors
              using the cmap and norm specified via kwargs (see below).
              Note that c should not be a single numeric RGB or RGBA
              sequence because that is indistinguishable from an array
              of values to be colormapped. c can be a 2-D array in which
              the rows are RGB or RGBA, however.

        The marker can be one of

            's' : square
            'o' : circle
            '^' : triangle up
            '>' : triangle right
            'v' : triangle down
            '<' : triangle left
            'd' : diamond
            'p' : pentagram
            'h' : hexagon
            '8' : octagon

        If marker is None and verts is not None, verts is a sequence
        of (x,y) vertices for a custom scatter symbol.

        s is a size argument in points squared.

        Any or all of x, y, s, and c may be masked arrays, in which
        case all masks will be combined and only unmasked points
        will be plotted.

        Other keyword args; the color mapping and normalization arguments will
        be used only if c is an array of floats

          * cmap = cm.jet : a colors.Colormap instance from cm.
            defaults to rc image.cmap

          * norm = colors.Normalize() : colors.Normalize instance
            is used to scale luminance data to 0,1.

          * vmin=None and vmax=None : vmin and vmax are used in conjunction
            with norm to normalize luminance data.  If either are None, the
            min and max of the color array C is used.  Note if you pass a norm
            instance, your settings for vmin and vmax will be ignored

          * alpha =1.0 : the alpha value for the patches

          * linewidths, if None, defaults to (lines.linewidth,).  Note
            that this is a tuple, and if you set the linewidths
            argument you must set it as a sequence of floats, as
            required by RegularPolyCollection -- see
            collections.RegularPolyCollection for details

         * faceted: if True, will use the default edgecolor for the
           markers.  If False, will set the edgecolors to be the same
           as the facecolors.
           This kwarg is deprecated;
           please use the edgecolors kwarg instead:
               shading='flat'    --> edgecolors='None'
               shading='faceted  --> edgecolors=None
           edgecolors also can be any mpl color or sequence of colors.

           Optional kwargs control the PatchCollection properties:
        %(PatchCollection)s

        A Collection instance is returned
        i   g      @i    R  i   R  i   t   ^g       @t   >R   t   <R  i   R  i   R   i   t   8i   t   +R%   R  R  R\   i   R,   s    Unknown marker symbol to scatters&   Cannot create markersymbol from markerg        t
   facecolorst
   edgecolorst
   linewidthst   offsetst   transOffsetNg      R@g?(   i   i    i    (   i   i    i    (   i   i    i    (   i   i    i    (   i   i    i    (   i   i    i    (   i   i    i   (   i   i   (3   R   R   RM  R  R  R)   R   Rm   Rq   R   R,   R-   R.   t   to_rgba_listR   R   R0   R   t
   is_numlikeRs   Rp   R  R  R   t   dpiR   R   t   StarPolygonCollectiont   AsteriskPolygonCollectionR^  RL  t   PolyCollectionR  R   R  t	   set_alphaRy  R<  t	   NormalizeR_   t   Colormapt	   set_arrayt   set_cmapt   set_normt   set_climt   autoscale_NoneR  R  R  R  R  (&   RJ   R%   RD   R  R<   R:   t   cmapt   normt   vmint   vmaxt   alphaRd  t   facetedRh  R\   t   symst   shR   t   scalesRc  R9  t   symstylet   numsidest   rotationR  t   rescaleR$   t   temp_xt   temp_yR  R  R2  R3  R   R   t   padxt   padyR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   scatter  s    [							!*

&			A
#%++

(
c         K   s,   t  i | | | | |  } |  i |  | S(   s   
        Draws arrow on specified axis from (x,y) to (x+dx,y+dy).

        Optional kwargs control the arrow properties:
        %(FancyArrow)s
        (   R   t
   FancyArrowR  (   RJ   R%   RD   R  R  R\   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   arrow  s    c         O   s#   t  i | |   } |  i |  | S(   N(   t   mquivert	   QuiverKeyR  (   RJ   R#   t   kwt   qk(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt	   quiverkey  s    c         O   sF   t  i |  | |  } |  i |  |  i | i | i  |  i   | S(   N(   R  t   QuiverR  R  t   XR  R  (   RJ   R#   R  t   q(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s
    
c         O   sc   |  i  p |  i   n g  } x4 |  i | |   D]  } |  i |  | i |  q1 W|  i   | S(   sP  
        FILL(*args, **kwargs)

        plot filled polygons.  *args is a variable length argument, allowing
        for multiple x,y pairs with an optional color format string; see plot
        for details on the argument parsing.  For example, all of the
        following are legal, assuming ax is an Axes instance:

          ax.fill(x,y)            # plot polygon with vertices at x,y
          ax.fill(x,y, 'b' )      # plot polygon with vertices at x,y in blue

        An arbitrary number of x, y, color groups can be specified, as in
          ax.fill(x1, y1, 'g', x2, y2, 'r')

        Return value is a list of patches that were added

        The same color strings that plot supports are supported by the fill
        format string.

        If you would like to fill below a curve, eg shade a region
        between 0 and y along x, use mlab.poly_between, eg

          xs, ys = poly_between(x, 0, y)
          axes.fill(xs, ys, facecolor='red', alpha=0.5)

        See examples/fill_between.py for more examples.

        kwargs control the Polygon properties:
        %(Polygon)s
        (   R   R   R   R  R"   R  (   RJ   R#   R\   R   t   poly(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRi     s     
g      @c         K   s  |  i  p |  i   n | d j	 o t | t i  p t  n | d j	 o t | t i  p t  n | d j o t d } n |  i	 |  t
 i |  | | | |	 |
 d | d | | } | i |  | i |  |  i |  | d j	 p | d j	 o | i | |  n | i   | i   \ } } } } | | f | | f f } |  i |  |  i o* |  i | | f  |  i | | f  n |  i i |  | S(   s
  

        IMSHOW(X, cmap=None, norm=None, aspect=None, interpolation=None,
               alpha=1.0, vmin=None, vmax=None, origin=None, extent=None)

        IMSHOW(X) - plot image X to current axes, resampling to scale to axes
                    size (X may be numpy array or PIL image)

        IMSHOW(X, **kwargs) - Use keyword args to control image scaling,
        colormapping etc. See below for details


        Display the image in X to current axes.  X may be a float array, a
        uint8 array or a PIL image. If X is an array, X can have the following
        shapes:

            MxN    : luminance (grayscale, float array only)

            MxNx3  : RGB (float or uint8 array)

            MxNx4  : RGBA (float or uint8 array)

        The value for each component of MxNx3 and MxNx4 float arrays should be
        in the range 0.0 to 1.0; MxN float arrays may be normalised.

        A image.AxesImage instance is returned

        The following kwargs are allowed:

          * cmap is a cm colormap instance, eg cm.jet.  If None, default to rc
            image.cmap value (Ignored when X has RGB(A) information)

          * aspect is one of: auto, equal, or a number.  If None, default to rc
            image.aspect value

          * interpolation is one of:

            'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36',
            'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
            'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
            'lanczos', 'blackman'

            if interpolation is None, default to rc
            image.interpolation.  See also th the filternorm and
            filterrad parameters

          * norm is a mcolors.Normalize instance; default is
            normalization().  This scales luminance -> 0-1 (only used for an
            MxN float array).

          * vmin and vmax are used to scale a luminance image to 0-1.  If
            either is None, the min and max of the luminance values will be
            used.  Note if you pass a norm instance, the settings for vmin and
            vmax will be ignored.

          * alpha = 1.0 : the alpha blending value

          * origin is 'upper' or 'lower', to place the [0,0]
            index of the array in the upper left or lower left corner of
            the axes.  If None, default to rc image.origin

          * extent is (left, right, bottom, top) data values of the
            axes.  The default assigns zero-based row, column indices
            to the x, y centers of the pixels.

          * shape is for raw buffer images

          * filternorm is a parameter for the antigrain image resize
            filter.  From the antigrain documentation, if normalize=1,
            the filter normalizes integer values and corrects the
            rounding errors. It doesn't do anything with the source
            floating point values, it corrects only integers according
            to the rule of 1.0 which means that any sum of pixel
            weights must be equal to 1.0.  So, the filter function
            must produce a graph of the proper shape.

         * filterrad: the filter radius for filters that have a radius
           parameter, ie when interpolation is one of: 'sinc',
           'lanczos' or 'blackman'

        Additional kwargs are martist properties
        s   image.aspectt
   filternormt	   filterradN(   R   R   R,   R<  R-   Rn  R_   Ro  R7   R   R  R  t   set_dataRm  R  Rs  Rt  t
   get_extentR  R'  R   R   R%  R"   (   RJ   R  Ru  Rv  R=  t   interpolationRy  Rw  Rx  t   origint   extentRq   R  R  t   imlimR\   R  R   R   R   R   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   imshow  s,    b++

c         G   s  t  |  d j oO | d } | i \ } } t i t i | d  t i | d   \ } } n= t  |  d j o | \ } } } n t d | | f   | i d } | i d }	 t  | i  d j p | i d d j o+ | i d |  }
 |
 i |	 d d } n t  | i  d j p | i d d j o+ | i |	 d  } | i | d d } n | i | i j o t d | | f   n | | | f S(	   Ni   i    i   s%   Illegal arguments to %s; see help(%s)ii   R   s,   Incompatible X, Y inputs to %s; see help(%s)(   R   Rq   Rm   t   meshgridRn   Ra   t   reshapeRw   (   RJ   t   funcnameR#   R   t   numRowst   numColsR  R  R  t   NyR%   RD   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   _pcolorargsd  s(    
6**c   '      O   s%  |  i  p |  i   n | i d d  } | i d d  } | i d d  } | i d d  } | i d d  } | i d d  } |  i d	 |  \ }	 }
 } |	 i \ } } t i |  } t i |	  }	 t i |
  }
 t i |	  t i |
  } | d
 d  d
 d  f | d d  d d  f | d
 d  d d  f | d d  d
 d  f } t i |  d
 | d  d
 | d  f | } t	 i
 } t	 i } | d
 j i   } | | t i |	 d
 d  d
 d  f  i    } | | t i |
 d
 d  d
 d  f  i    } | | t i |	 d d  d
 d  f  i    } | | t i |
 d d  d
 d  f  i    } | | t i |	 d d  d d  f  i    } | | t i |
 d d  d d  f  i    } | | t i |	 d
 d  d d  f  i    } | | t i |
 d
 d  d d  f  i    } t |  } t	 i | d d  | f | d d  | f | d d  | f | d d  | f | d d  | f | d d  | f | d d  | f | d d  | f f d d } | i | d d f  } | | t i | d
 | d  d
 | d  f  i    } | d j o
 d } n d } | i d |  | i d d  | i d d  t i | |  } | i |  | i |  | d j	 o t | t i  p t  n | d j	 o t | t i  p t  n | i |  | i |  | d j	 p | d j	 o | i | |  n | i   |  i t   |	 i!   }  |
 i!   }! t	 i" |   }" t	 i# |   }# t	 i" |!  }$ t	 i# |!  }% |" |$ f |# |% f f }& |  i$ |&  |  i%   |  i& |  | S(   s  
        pcolor(*args, **kwargs): pseudocolor plot of a 2-D array

        Function signatures

          pcolor(C, **kwargs)
          pcolor(X, Y, C, **kwargs)

        C is the array of color values

        X and Y, if given, specify the (x,y) coordinates of the colored
        quadrilaterals; the quadrilateral for C[i,j] has corners at
        (X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]),
        (X[i+1,j+1],Y[i+1,j+1]).  Ideally the dimensions of X and Y
        should be one greater than those of C; if the dimensions are the
        same, then the last row and column of C will be ignored.

        Note that the the column index corresponds to the x-coordinate,
        and the row index corresponds to y; for details, see
        the "Grid Orientation" section below.

        If either or both of X and Y are 1-D arrays or column vectors,
        they will be expanded as needed into the appropriate 2-D arrays,
        making a rectangular grid.

        X,Y and C may be masked arrays.  If either C[i,j], or one
        of the vertices surrounding C[i,j] (X or Y at [i,j],[i+1,j],
        [i,j+1],[i=1,j+1]) is masked, nothing is plotted.

        Optional keyword args are shown with their defaults below (you must
        use kwargs for these):

          * cmap = cm.jet : a cm Colormap instance from cm

          * norm = Normalize() : mcolors.Normalize instance
            is used to scale luminance data to 0,1.

          * vmin=None and vmax=None : vmin and vmax are used in conjunction
            with norm to normalize luminance data.  If either are None, the
            min and max of the color array C is used.  If you pass a norm
            instance, vmin and vmax will be None

          * shading = 'flat' : or 'faceted'.  If 'faceted', a black grid is
            drawn around each rectangle; if 'flat', edges are not drawn.
            Default is 'flat', contrary to Matlab(TM).
            This kwarg is deprecated;
            please use the edgecolors kwarg instead:
                shading='flat'    --> edgecolors='None'
                shading='faceted  --> edgecolors='k'
            edgecolors can also be None to specify the rcParams
            default, or any mpl color or sequence of colors.

          * alpha=1.0 : the alpha blending value

        Return value is a mcoll.PatchCollection
        object

        Grid Orientation

            The orientation follows the Matlab(TM) convention: an
            array C with shape (nrows, ncolumns) is plotted with
            the column number as X and the row number as Y, increasing
            up; hence it is plotted the way the array would be printed,
            except that the Y axis is reversed.  That is, C is taken
            as C(y,x).

            Similarly for meshgrid:

                x = npy.arange(5)
                y = npy.arange(3)
                X, Y = meshgrid(x,y)

            is equivalent to

                X = array([[0, 1, 2, 3, 4],
                          [0, 1, 2, 3, 4],
                          [0, 1, 2, 3, 4]])

                Y = array([[0, 0, 0, 0, 0],
                          [1, 1, 1, 1, 1],
                          [2, 2, 2, 2, 2]])

            so if you have
                C = rand( len(x), len(y))
            then you need
                pcolor(X, Y, C.T)
            or
                pcolor(C.T)

        Dimensions

            Matlab pcolor always discards
            the last row and column of C, but matplotlib displays
            the last row and column if X and Y are not specified, or
            if X and Y have one more row and column than C.


        kwargs can be used to control the PolyCollection properties:
        %(PolyCollection)s
        Ry  g      ?Rv  Ru  Rw  Rx  t   shadingt   flatt   pcolori    ii   NR   i   i   Rz  R,   Rc  t   antialiasedsRd  g      ?(   i    i    i    i   (   (   i    i    i    i   (   i    (   g      ?('   R   R   RX   R,   R  Rq   R   Rp   R   Rm   Rr   R7  R5  t   filledR   t   concatenateR  R  R  Rl  Rm  Rp  R<  R-   Rn  R_   Ro  Rq  Rr  Rs  Rt  R(  Ro   R!   R  R  R  R  R  ('   RJ   R#   R\   Ry  Rv  Ru  Rw  Rx  R  R  R  R   R  R  R   t   xymaskRr   R7  t	   ravelmaskt   X1t   Y1t   X2t   Y2t   X3t   Y3t   X4t   Y4t   npolyR  Rh  Rc  R  R%   RD   R  R  R2  R3  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  |  s|    fj1		44444444,&&,	<
++

c         O   s  |  i  p |  i   n | i d d  } | i d d  } | i d d  } | i d d  } | i d d  } | i d d  } | i d	 d
  }	 |  i d |  \ }
 } } |
 i \ } } t i | d | d  d | d  f  } |
 i   }
 | i   } t i	 | | d f d t
 } |
 | d d  d f <| | d d  d f <| d j p |	 d
 j o
 d } n d } t i | d | d | |  } | i |  | i |  | d j	 o t | t i  p t  n | d j	 o t | t i  p t  n | i |  | i |  | d j	 p | d j	 o | i | |  n | i   |  i t  t i |
  } t i |
  } t i |  } t i |  } | | f | | f f } |  i |  |  i   |  i |  | S(   s  
        PCOLORMESH(*args, **kwargs)

        Function signatures

          PCOLORMESH(C) - make a pseudocolor plot of matrix C

          PCOLORMESH(X, Y, C) - a pseudo color plot of C on the matrices X and Y

          PCOLORMESH(C, **kwargs) - Use keyword args to control colormapping and
                                scaling; see below

        C may be a masked array, but X and Y may not.  Masked array support
        is implemented via cmap and norm; in contrast, pcolor simply does
        not draw quadrilaterals with masked colors or vertices.

        Optional keyword args are shown with their defaults below (you must
        use kwargs for these):

          * cmap = cm.jet : a cm Colormap instance from cm.

          * norm = Normalize() : colors.Normalize instance
            is used to scale luminance data to 0,1.  Instantiate it
            with clip=False if C is a masked array.

          * vmin=None and vmax=None : vmin and vmax are used in conjunction
            with norm to normalize luminance data.  If either are None, the
            min and max of the color array C is used.

          * shading = 'flat' : or 'faceted'.  If 'faceted', a black grid is
            drawn around each rectangle; if 'flat', edges are not drawn.
            Default is 'flat', contrary to Matlab(TM).
            This kwarg is deprecated;
            please use the edgecolors kwarg instead:
                shading='flat'    --> edgecolors='None'
                shading='faceted  --> edgecolors='k'
            More flexible specification of edgecolors, as in pcolor,
            is not presently supported.

          * alpha=1.0 : the alpha blending value

        Return value is a collections.PatchCollection
        object

        See pcolor for an explantion of the grid orientation and the
        expansion of 1-D X and/or Y to 2-D arrays.

        kwargs can be used to control the collections.QuadMesh polygon
        collection properties:

        %(QuadMesh)s
        Ry  g      ?Rv  Ru  Rw  Rx  R  R  Rc  R,   t
   pcolormeshi    i   i   R  NRz  (   R   R   RX   R,   R  Rq   R   R5  Rm   R  R<  R  t   QuadMeshRm  Rp  R<  R-   Rn  R_   Ro  Rq  Rr  Rs  Rt  R(  Ro   R  R  R  R  R  (   RJ   R#   R\   Ry  Rv  Ru  Rw  Rx  R  Rc  R  R  R   R  R  t   coordst	   showedgesR  R  R  R2  R3  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  5  sP    5-
++

c         O   s  |  i  p |  i   n | i d d  } | i d d  } | i d d  } | i d d  } | i d d  } | d j	 o t | t i  p t  n | d j	 o t | t i  p t  n | d } | i	 \ }	 }
 t
 |  d j o* d	 } d
 |
 d g } d
 |	 d g } nVt
 |  d j o6| d  \ } } t i |  } t i |  } | i d j o | i d j o | i d j o | i d j o
 d	 } qct i |  } t i |  } t i |  d t i | i    j  o3 t i |  d t i | i    j  o
 d	 } n d } qs| i d j o | i d j o
 d } qst d   n t d   | d j ot i |  } | i   } | i   } |
 d } |	 d } t i | | d f t i  } | | d d  d
 f <| | d d  d f <t i |
 |	 | d
  } | i |  | i |  | i |  | i |  |  i |  | i   | i    | i   | i    f \ } } } } | } n/ | d
 | d | d
 | d f \ } } } } | d	 j oj t! i" |  | | d d d d d | | | | f | } | i# |  | i |  |  i$ i% |  | } n | d j oG t! i& |  | | | d | d | d | | } |  i$ i% |  | } n |  i' |  | d j	 p | d j	 o | i( | |  n | i)   |  i* t i+ | | g | | g g   |  i, d t-  | S(   s;  
        Experimental; this is a version of pcolor that
        does not draw lines, that provides the fastest
        possible rendering with the Agg backend, and that
        can handle any quadrilateral grid.

        pcolor(*args, **kwargs): pseudocolor plot of a 2-D array

        Function signatures

          pcolor(C, **kwargs)
          pcolor(xr, yr, C, **kwargs)
          pcolor(x, y, C, **kwargs)
          pcolor(X, Y, C, **kwargs)

        C is the 2D array of color values corresponding to quadrilateral
        cells. Let (nr, nc) be its shape.  C may be a masked array.

        pcolor(C, **kwargs) is equivalent to
        pcolor([0,nc], [0,nr], C, **kwargs)

        xr, yr specify the ranges of x and y corresponding to the rectangular
        region bounding C.  If xr = [x0, x1] and yr = [y0,y1] then
        x goes from x0 to x1 as the second index of C goes from 0 to nc,
        etc.  (x0, y0) is the outermost corner of cell (0,0), and (x1, y1)
        is the outermost corner of cell (nr-1, nc-1).  All cells are
        rectangles of the same size.  This is the fastest version.

        x, y are 1D arrays of length nc+1 and nr+1, respectively, giving
        the x and y boundaries of the cells.  Hence the cells are
        rectangular but the grid may be nonuniform.  The speed is
        intermediate.  (The grid is checked, and if found to be
        uniform the fast version is used.)

        X and Y are 2D arrays with shape (nr+1, nc+1) that specify
        the (x,y) coordinates of the corners of the colored
        quadrilaterals; the quadrilateral for C[i,j] has corners at
        (X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]),
        (X[i+1,j+1],Y[i+1,j+1]).  The cells need not be rectangular.
        This is the most general, but the slowest to render.  It may
        produce faster and more compact output using ps, pdf, and
        svg backends, however.

        Note that the the column index corresponds to the x-coordinate,
        and the row index corresponds to y; for details, see
        the "Grid Orientation" section below.

        Optional keyword args are shown with their defaults below (you must
        use kwargs for these):

          * cmap = cm.jet : a cm Colormap instance from cm

          * norm = Normalize() : mcolors.Normalize instance
            is used to scale luminance data to 0,1.

          * vmin=None and vmax=None : vmin and vmax are used in conjunction
            with norm to normalize luminance data.  If either are None, the
            min and max of the color array C is used.  If you pass a norm
            instance, vmin and vmax will be None

          * alpha=1.0 : the alpha blending value

        Return value is an image if a regular or rectangular grid
        is specified, and a QuadMesh collection in the general
        quadrilateral case.

        Ry  g      ?Rv  Ru  Rw  Rx  ii   R   i    i   i   g{Gz?t   pcolorimaget   quadmeshs'   arguments do not match valid signaturess   need 1 argument or 3 argumentsNR  t   nearestR  R{  R  Ry  (.   R   R   RX   R,   R<  R-   Rn  R_   Ro  Rq   R   Rm   Rp   t   ndimR  t   difft   ptpRQ  t   meanRa   R   R5  t   emptyt   float64R  R  Rm  Rp  Rq  Rr  R  R  RL  R  R  R  R%  R"   t   PcolorImageR  Rs  Rt  R  R  R  Rs   (   RJ   R#   R\   Ry  Rv  Ru  Rw  Rx  R   Rt   Ru   R  R%   RD   R  R  R  R  R  R  R  R  R  Rb  t   ybRj  R]   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt
   pcolorfast  s    E++
  
))

 


6
.	
	

(c         O   s   t  | d <t i |  | |  S(   NR  (   Ro   t   mcontourt
   ContourSet(   RJ   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   K  s    
c         O   s   t  | d <t i |  | |  S(   NR  (   Rs   R  R  (   RJ   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   contourfP  s    
c         O   s   | i  | |   S(   N(   t   clabel(   RJ   t   CSR#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  U  s    c         K   s   t  i |  |  S(   sE  
        TABLE(cellText=None, cellColours=None,
              cellLoc='right', colWidths=None,
              rowLabels=None, rowColours=None, rowLoc='left',
              colLabels=None, colColours=None, colLoc='center',
              loc='bottom', bbox=None):

        Add a table to the current axes.  Returns a table instance.  For
        finer grained control over tables, use the Table class and add it
        to the axes with add_table.

        Thanks to John Gill for providing the class and table.

        kwargs control the Table properties:
        %(Table)s
        (   t   mtableR   (   RJ   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   Z  s    c         C   sR   |  i  i |  i   d |  d t } | i i   | i i d  |  i i   | S(   s   
        ax = twinx()

        create a twin of Axes for generating a plot with a sharex
        x-axis but independent y axis.  The y-axis of self will have
        ticks on left and the returned axes will have ticks on the
        right
        R   R   R   (   R   t   add_axesR  Ro   RW   t
   tick_rightt   set_label_positiont	   tick_left(   RJ   t   ax2(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   twinxn  s
    
$c         C   sR   |  i  i |  i   d |  d t } | i i   | i i d  |  i i   | S(   s   
        ax = twiny()

        create a twin of Axes for generating a plot with a shared
        y-axis but independent x axis.  The x-axis of self will have
        ticks on bottom and the returned axes will have ticks on the
        top
        R   R   R   (   R   R  R  Ro   RV   t   tick_topR  t   tick_bottom(   RJ   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   twiny~  s
    
$c	         K   s  |  i  p |  i   n t i | | d d d | \ }
 } | d j o d | d | d } n | d j o. |  i | |
 d | d | d	 | d
 | } nI | d j o. |  i | |
 d | d | d	 | d
 | } n t d |  x | D] } | i |	  q W|
 | t	 i
 d |  f S(   s  
        HIST(x, bins=10, normed=0, bottom=None,
             align='edge', orientation='vertical', width=None,
             log=False, **kwargs)

        Compute the histogram of x.  bins is either an integer number of
        bins or a sequence giving the bins.  x are the data to be binned.

        The return values is (n, bins, patches)

        If normed is true, the first element of the return tuple will
        be the counts normalized to form a probability density, ie,
        n/(len(x)*dbin).  In a probability density, the integral of
        the histogram should be one (we assume equally spaced bins);
        you can verify that with

          # trapezoidal integration of the probability density function
          pdf, bins, patches = ax.hist(...)
          print npy.trapz(pdf, bins)

        align = 'edge' | 'center'.  Interprets bins either as edge
        or center values

        orientation = 'horizontal' | 'vertical'.  If horizontal, barh
        will be used and the "bottom" kwarg will be the left edges.

        width: the width of the bars.  If None, automatically compute
        the width.

        log: if True, the histogram axis will be set to a log scale

        kwargs are used to update the properties of the
        hist Rectangles:
        %(Rectangle)s
        R   R  g?i   i    R  R  R   R  R   R  R  R   s   invalid orientation: %sRe  N(   R   R   Rm   t	   histogramR,   R  R  R0   Ry  R   R  (   RJ   R%   t   binsR  R   R  R  R  R   R\   t   nR   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   hist  s    &$' i   i   c         K   s<  |  i  p |  i   n t i | | | | | |  \ }	 }
 t |
  f |	 _ |
 | 7}
 |  i |
 d t i |	  |  |  i	 d  |  i
 d  |  i t  |  i i   i   \ } } | | } t t i |   } | d j o
 d } n d | } t i t i |  t i |  d |  } |  i |  |	 |
 f S(   s  
        PSD(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
            window=mlab.window_hanning, noverlap=0, **kwargs)

        The power spectral density by Welches average periodogram method.  The
        vector x is divided into NFFT length segments.  Each segment is
        detrended by function detrend and windowed by function window.
        noperlap gives the length of the overlap between segments.  The
        absolute(fft(segment))**2 of each segment are averaged to compute Pxx,
        with a scaling to correct for power loss due to windowing.  Fs is the
        sampling frequency.

            * NFFT is the length of the fft segment; must be a power of 2

            * Fs is the sampling frequency.

            * Fc is the center frequency of x (defaults to 0), which offsets
              the yextents of the image to reflect the frequency range used
              when a signal is acquired and then filtered and downsampled to
              baseband.

            * detrend - the function applied to each segment before fft-ing,
              designed to remove the mean or linear trend.  Unlike in matlab,
              where the detrend parameter is a vector, in matplotlib is it a
              function.  The mlab module defines detrend_none, detrend_mean,
              detrend_linear, but you can use a custom function as well.

            * window - the function used to window the segments.  window is a
              function, unlike in matlab(TM) where it is a vector.  mlab defines
              window_none, window_hanning, but you can use a custom function
              as well.

            * noverlap gives the length of the overlap between segments.

        Returns the tuple Pxx, freqs

        For plotting, the power is plotted as 10*npy.log10(pxx) for decibels,
        though pxx itself is returned

        Refs:

          Bendat & Piersol -- Random Data: Analysis and Measurement
          Procedures, John Wiley & Sons (1986)

        kwargs control the Line2D properties:
        %(Line2D)s
        i
   t	   Frequencys   Power Spectrum (dB)i    g?i   (   R   R   R   t   psdR   Rq   RF   Rm   t   log10R}  R  R(  Rs   R   R  R  RR   Rn   RM  t   floort   ceilR5  (   RJ   R%   t   NFFTt   Fst   FcR  t   windowt   noverlapR\   t   pxxt   freqsRw  Rx  t   intvt   logiR  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s     1$
 

+c	         K   s+  |  i  p |  i   n t i | | | | | | |  \ }
 } t |  f |
 _ | | 7} |  i | d t i t i	 |
   |	  |  i
 d  |  i d  |  i t  |  i i   i   \ } } | | } d t t i |   } t i t i |  t i |  d |  } |  i |  |
 | f S(   s  
        CSD(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
            window=window_hanning, noverlap=0, **kwargs)

        The cross spectral density Pxy by Welches average periodogram method.
        The vectors x and y are divided into NFFT length segments.  Each
        segment is detrended by function detrend and windowed by function
        window.  The product of the direct FFTs of x and y are averaged over
        each segment to compute Pxy, with a scaling to correct for power loss
        due to windowing.

        See the PSD help for a description of the optional parameters.

        Returns the tuple Pxy, freqs.  Pxy is the cross spectrum (complex
        valued), and 10*npy.log10(|Pxy|) is plotted

        Refs:
          Bendat & Piersol -- Random Data: Analysis and Measurement
            Procedures, John Wiley & Sons (1986)

        kwargs control the Line2D properties:
        %(Line2D)s
        i
   R  s   Cross Spectrum Magnitude (dB)i   (   R   R   R   t   csdR   Rq   RF   Rm   R  t   absoluteR}  R  R(  Rs   R   R  R  RR   Rn   RM  R  R  R5  (   RJ   R%   RD   R  R  R  R  R  R  R\   t   pxyR  Rw  Rx  R  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    '
)
+c	         K   s   |  i  p |  i   n t i | | | | | | |  \ }
 } | | 7} |  i | |
 |	  |  i d  |  i d  |  i t  |
 | f S(   s  
        COHERE(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none,
              window = mlab.window_hanning, noverlap=0, **kwargs)

        cohere the coherence between x and y.  Coherence is the normalized
        cross spectral density

          Cxy = |Pxy|^2/(Pxx*Pyy)

        The return value is (Cxy, f), where f are the frequencies of the
        coherence vector.

        See the PSD help for a description of the optional parameters.

        kwargs are applied to the lines

        Returns the tuple Cxy, freqs

        Refs: Bendat & Piersol -- Random Data: Analysis and Measurement
          Procedures, John Wiley & Sons (1986)

        kwargs control the Line2D properties of the coherence plot:
        %(Line2D)s
        R  t	   Coherence(	   R   R   R   t   cohereRF   R}  R  R(  Rs   (   RJ   R%   RD   R  R  R  R  R  R  R\   t   cxyR  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  <  s    '
i   c
         C   s   |  i  p |  i   n t i | | | | | |  \ }
 } } d t i |
  } t i |  } |	 d j o d t i |  f }	 n |	 \ } } | | 7} | | | d | d f } |  i	 | | d | } |  i
 d  |
 | | | f S(   s  
        SPECGRAM(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
                 window = mlab.window_hanning, noverlap=128,
                 cmap=None, xextent=None)

        Compute a spectrogram of data in x.  Data are split into NFFT length
        segements and the PSD of each section is computed.  The windowing
        function window is applied to each segment, and the amount of overlap
        of each segment is specified with noverlap.

            * cmap is a colormap; if None use default determined by rc

            * xextent is the image extent in the xaxes xextent=xmin, xmax -
              default 0, max(bins), 0, max(freqs) where bins is the return
              value from mlab.specgram

            * See help(psd) for information on the other keyword arguments.

        Return value is (Pxx, freqs, bins, im), where

            bins are the time points the spectrogram is calculated over

            freqs is an array of frequencies

            Pxx is a len(times) x len(freqs) array of power

            im is a image.AxesImage.

        Note: If x is real (i.e. non-complex) only the positive spectrum is
        shown.  If x is complex both positive and negative parts of the
        spectrum are shown.
        i
   i    iR  R   N(   R   R   R   t   specgramRm   R  t   flipudR,   R  R  R   (   RJ   R%   R  R  R  R  R  R  Ru  t   xextentt   PxxR  R  t   ZR   R   R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  b  s    #&
R;  c         K   s  | d$ j o | d$ j o t | d  o t d  n t i |  } | d$ j o | d j } n t i |  | j } d | j o# t i d d g d d | d <n | i \ } }	 d	 |	 d
 | d
 d	 g }
 |  i	 | d d d | d |
 d d | } nCt | d  o+ | i
   } | i } | i } | i } n] t i |  } | d$ j o | d j } n t i |  | j } t i | |  \ } } } | d$ j o
 d } n | d$ j o
 d } n |  i | | d d d | d | | } | i \ } }	 |  i d d	 d |	 d
  |  i d | d
 d d	  |  i |  | } |  i i d  |  i i   |  i i d  |  i i t i d d d d  d! d" d g d# t   |  i i t i d d d d  d! d" d g d# t   | S(%   s  
        spy(Z) plots the sparsity pattern of the 2-D array Z

        If precision is None, any non-zero value will be plotted;
        else, values of absolute(Z)>precision will be plotted.

        The array will be plotted as it would be printed, with
        the first index (row) increasing down and the second
        index (column) increasing to the right.

        By default aspect is 'equal' so that each array element
        occupies a square space; set the aspect kwarg to 'auto'
        to allow the plot to fill the plot box, or to any scalar
        number to specify the aspect ratio of an array element
        directly.

        Two plotting styles are available: image or marker. Both
        are available for full arrays, but only the marker style
        works for scipy.sparse.spmatrix instances.

        If marker and markersize are None, an image will be
        returned and any remaining kwargs are passed to imshow;
        else, a Line2D object will be returned with the value
        of marker determining the marker type, and any remaining
        kwargs passed to the axes plot method.

        If marker and markersize are None, useful kwargs include:
            cmap
            alpha
        See documentation for imshow() for details.
        For controlling colors, e.g. cyan background and red marks, use:
            cmap = mcolors.ListedColormap(['c','r'])

        If marker or markersize is not None, useful kwargs include:
            marker
            markersize
            color
        See documentation for plot() for details.

        Useful values for marker include:
            's'  square (default)
            'o'  circle
            '.'  point
            ','  pixel

        t   tocoos/   Image mode does not support scipy.sparse arraysg        Ru  R   RE   t   namet   binaryg      g      ?R  R  R=  R  R  R  R  i
   R9   R,   R:   t
   markersizeR   R   R   R   g?R  t   nbinsi	   t   stepsi   i   i   t   integerN(   R,   R   Ra   Rm   Rp   R  R-   t   ListedColormapRq   R  R  R@  R  t   dataR   t   get_xyz_whereRF   R   R   R   R,  t   set_yRV   R  t   set_ticks_positionR	  R
  t   MaxNLocatorRs   RW   (   RJ   R  t	   precisionR:   R  R=  R\   R   Rt   Ru   R  R]   R<   RD   R%   t   zR   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   spy  sP    0#		

c      	   K   s  t  i |  } | i \ } } d | d | d d g } h  | d <d d <d d <d d	 <} | i |  |  i | |  } |  i i d
  |  i i   |  i i	 d  |  i i
 t i d d d d d d d g d t   |  i i
 t i d d d d d d d g d t   | S(   s  
        Plot a matrix as an image.

        The matrix will be shown the way it would be printed,
        with the first row at the top.  Row and column numbering
        is zero-based.

        Argument:
            Z   anything that can be interpreted as a 2-D array

        kwargs: all are passed to imshow.  matshow sets defaults
        for extent, origin, interpolation, and aspect; use care
        in overriding the extent and origin kwargs, because they
        interact.  (Also, if you want to change them, you probably
        should be using imshow directly in your own version of
        matshow.)

        Returns: an image.AxesImage instance

        g      g      ?R  R  R  R  R  R;  R=  g?R  R  i	   R  i   i   i   i
   R  (   Rm   Rp   Rq   Ry  R  R,  R  RV   R  R  R	  R
  R  Rs   RW   (   RJ   R  R\   Rt   Ru   R  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   matshow  s&    		

(   R   R   R   R   R  R  Rz  R   R,   Rs   RK   R   R   R   R   R   R   Ro   R  R
  R  R   R5  R6  R7  R9  R   RA  R   RD  R   Rv  R   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R~  R  R  R  R  R  t   _Axes__draw_animateR  R  R  R  R(  R   t   dedentR   t   kwdocdR  R}  R|  R  R  R  R  RK  RU  R   R   R  R  R  R  R!  R#  R%  R)  R*  R+  RO  RT  R   R   R/  R  R4  R5  R6  R7  R8  R9  R;  RE  RF  RH  RI  RL  RN  R   RP  R   RR  R   R   RV  RX  R  R]  t   _Axes__pickR{  R}  R  R   R  R  R  R  R  R  R  RF   R  R  R  R  R  R   t   detrend_noneR  R   R  R  R  R  R  R  R  R\  R  R  R  R  R  t   quiverkey_docR   R  t
   quiver_docRi   R  R  R  R  R  R   R  R  t   contour_docR  R  R   R  R  R  t   window_hanningR  R  R  R  R  R  (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s  	Z			 			(		>			#					b	;																								
				J											'								/	$						.	&						
										
	EI	""'&;A	p/	-		 	!@	u	5	<	 		 	
			'u			i									2C+#	3	[t   SubplotBasec           B   s_   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   s   
    Base class for subplots, which are Axes instances with additional
    methods to facilitate generating and manipulating a set of Axes
    within a figure.
    c         G   s   | |  _  t |  d j oO t | d  } t |  d j o t d   n t t |  \ } } } n3 t |  d j o | \ } } } n t d   | | } | d 8} | | j o t d   n | |  _ | |  _ | |  _ |  i	   d S(   s  
        fig is a figure instance

        args is numRows, numCols, plotNum
            where the array of subplots in the figure has dimensions
            numRows, numCols, and where plotNum is the number of the
            subplot being created.  plotNum starts at 1 in the upper
            right corner and increases to the right.

            If numRows<=numCols<=plotNum<10, args can be the decimal
            integer numRows*100 + numCols*10 + plotNum.
        i   i    i   s+   Argument to subplot must be a 3 digits longs   Illegal argument to subplots%   Subplot number exceeds total subplotsN(
   R   R   t   strR0   R   RR   t   _rowst   _colst   _numt   update_params(   RJ   R   R#   R  t   rowst   colsR	  t   total(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK   #  s"    	

			c         C   s   |  i  |  i |  i d f S(   s"   get the subplot geometry, eg 2,2,3i   (   R  R  R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   get_geometryH  s    c         C   sR   | |  _  | |  _ | d |  _ |  i   |  i |  i |  i |  i |  i g  d S(   s/   change subplot geometry, eg from 1,1,1 to 2,2,3i   N(	   R  R  R  R  R
  t   figLeftt	   figBottomRX  RY  (   RJ   t   numrowst   numcolsR	  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   change_geometryL  s
    		
c         C   s>  |  i  } |  i } |  i } |  i i } | i } | i } | i } | i } | i	 }	 | i
 }
 | | } | | } | | |
 | d } |
 | } | | |	 | d } |	 | } t | |  \ } } | | d | | | } | | | | } | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ d S(   s0   update the subplot position from fig.subplotparsi   N(   R  R  R  R   t   subplotparsR   R   R   R   t   wspacet   hspacet   divmodR  R  RX  RY  t   rowNumt   colNumR  R  (   RJ   R  R  R	  t   parsR   R   R   R   R  R  t   totWidtht	   totHeightRY  t   sepHRX  t   sepWR  R  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  T  s8    									



								c         C   s   |  i  d j S(   Ni    (   R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   is_first_col  s    c         C   s   |  i  d j S(   Ni    (   R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   is_first_row  s    c         C   s   |  i  |  i d j S(   Ni   (   R  R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   is_last_row  s    c         C   s   |  i  |  i d j S(   Ni   (   R  R  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   is_last_col  s    c         C   sd   |  i    } |  i   } x! |  i   D] } | i |  q% Wx! |  i   D] } | i |  qI Wd S(   s   
        set the visible property on ticklabels so xticklabels are
        visible only if the subplot is in the last row and yticklabels
        are visible only if the subplot is in the first column
        N(   R%  R#  R%  t   set_visibleR8  (   RJ   t   lastrowt   firstcolR   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   label_outer  s      (   R   R   R   RK   R  R  R  R#  R$  R%  R&  R*  (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR	    s   	%			2				t   Subplotc           B   s    e  Z d  Z d   Z d   Z RS(   s   
    subplot class for Cartesian Axes

    This is not normally instantiated by the user; instead,
    use the Figure.add_subplot method.
    c         C   s    d |  i  i   |  i i   f S(   Ns   Subplot(%g,%g)(   R   R   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         O   sE   t  i |  | |  t i |  | |  i |  i |  i |  i g |  d S(   sW   
        See SubplotBase and Axes base class documentation for args and kwargs
        N(   R	  RK   R   R  R  RX  RY  (   RJ   R   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK     s    (   R   R   R   R   RK   (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR+    s   	t	   PolarAxesc           B   sT  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 e d  Z d d d d  Z e i e i  e i e _ d d d d  Z e i e i  e i e _ d   Z d   Z d   Z d   Z d d  Z d d  Z d d e d  Z d d e d  Z d   Z d   Z d   Z  d   Z! RS(   s:  
    Make a PolarAxes.  The rectangular bounding box of the axes is given by


       PolarAxes(position=[left, bottom, width, height])

    where all the arguments are fractions in [0,1] which specify the
    fraction of the total figure window.

    axisbg is the color of the axis background

    Attributes:
      thetagridlines  : a list of Line2D for the theta grids
      rgridlines      : a list of Line2D for the radial grids
      thetagridlabels : a list of Text for the theta grid labels
      rgridlabels     : a list of Text for the theta grid labels

    id   c         O   s:   t  i |  | |  |  i d d d d d |  i   d S(   sG   
        See Axes base class for args and kwargs documentation
        R;  R>  R   R?  R   N(   R   RK   R   R   (   RJ   R#   t   kwarg(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK     s    c         C   s   d |  _ d |  _ d S(   s   nuthin to doN(   R,   RV   RW   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    	c         C   s  t  i } t  i } t  i } | | | d t i  | t i d    | | d t i  | t i d     |  _ | | | d t i  | t i d    | | d	 t i  | t i d     |  _ t  i	 |  i |  i
 t  i t  i   |  _ t  i t  i   |  i
  |  _ d S(
   s   
        set the dataLim and viewLim BBox attributes and the
        transData and transAxes Transformation attributes
        i   g      @i   i   Ng      ?g      ?g      ?g      ?(   R   R   R   R   RM  R  R^  R   R   t   NonseparableTransformationR   t   FuncXYt   POLARR   R   R   R   (   RJ   R   R   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    			+1+1c         C   su   t  |  i  o |  i |  |  Sn |  i i i | i | i f  \ } } | d d | d d d j } | h  f S(   sS   Test whether the mouse event occured in the axes.

        Returns T/F, {}
        g      ?i   g      ?(   RY  RZ  RG   R   t   inverse_xy_tupR%   RD   (   RJ   R[  R%   RD   R\  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    s    $' c         C   s  t  |   |  _ t  |  d  |  _ t d |  _ g  |  _ g  |  _ g  |  _ g  |  _ g  |  _	 g  |  _
 g  |  _ g  |  _ g  |  _ g  |  _ d |  _ |  i |  i  t i d t d  } t i d d d d d	 d
 d | d d d d  |  _ |  i i |  i  |  i |  i  t i d d t i |  i  |  _ t  |  i t i! |  i   } t" i# | d |  i$ d t d |  _% |  i% i& |  i'  |  i% i |  i(  |  i% i) t d  t* |  _+ t, i- } t, i. } | | d  | d   |  _/ | | d  | d   |  _0 t1 i2   |  _3 |  i3 i4 |  i/  |  i3 i5 |  i0  d t1 i6 f d     Y} |   |  _7 |  i7 i4 |  i/  |  i7 i5 |  i0  t i8 d d d  } t i8 d d d  } |  i9 |  |  i: |  d S(   s   Clear the current axesRi   s   polaraxes.gridR  s   axes.titlesizeR%   g      ?RD   g?R   R*   R  R  R   R  R  i    i   R   R  s   axes.edgecolors   axes.linewidthi   t   RadialLocatorc           B   s   e  Z d  Z d   Z RS(   s&   enforce strictly positive radial ticksc         S   sB   t  i i |   } g  } | D] } | d j o | | q q ~ S(   Ni    (   R
  R  R^   (   RJ   R  R$   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR^   =  s    (   R   R   R   R^   (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR2  :  s   ih  i-   g?g?N(;   R?   R  R   R7   R!  t   thetagridlabelst   thetagridlinest   rgridlabelst
   rgridlinesR   R%  R   R$  R   R"  R,   R&  R(  R
   R)  R*  R+  R,  R  R   R  Rm   t   linspaceRM  R  t
   RESOLUTIONt   thetasR   R  R   R   R   R/  R   R   R   R0  Rs   R3  R   R   t   Intervalt   rintvt   rintdR
  R  t
   rformattert   set_view_intervalt   set_data_intervalR  t   rlocatorRn   t   set_thetagridst
   set_rgrids(   RJ   R4  Rh  R   R:  R2  t   anglest   radii(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s`    												"				c         C   s   g  } | i  |  i  | i  |  i  | i  |  i  | i  |  i  | i  |  i  | i  |  i  | i  |  i  | i  |  i  | i  |  i	  |  i
 d j	 o | i |  i
  n | i  |  i  | i |  i  | i |  i  | S(   s   return a list of child artistsN(   R  R6  R5  R4  R3  R   R   R"  R$  R%  R&  R,   R"   R   R,  R/  (   RJ   RW  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRX  K  s     c         C   s$   |  i  i d |  |  i |  d  S(   Ni    (   R;  R  t   regrid(   RJ   t   rmax(    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyt   set_rmax_  s    c         C   s   | |  _  d S(   s,   Set the axes grids on or off; b is a booleanN(   R!  (   RJ   R@   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR(  c  s    c         C   s   t  |  } t |  i | t i |  i   |  i _ | t i	 d  } |  i
 i   i | |  |  i   } |  i |  |  i i |  x" |  i D] } | i d |  q Wt i d | |  i  } x |  i D] } | i |  q Wd  S(   Ni   g?i    (   R<  R   R9  Rm   R  R8  R/  R  RM  R^  R   R  R  R@  RB  R=  t   set_locsR3  R  R7  R4  t	   set_ydata(   RJ   RF  Re   R  R  RB   R   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRE  g  s    (
 
 c         C   sR   |  i  i d |  i    |  i i   \ } } |  i i | |  |  i |  d S(   s7   set the view limits to include all the data in the axesi    N(   R<  R  t   get_rmaxR@  R  R;  RE  (   RJ   R  R  t   rminRF  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  y  s    g     6@g?c         K   s6  t  i |  } | i   } | d j o t d   n | t |  } t i |  i  t  i d d t	 i
 |  i  } t d } t d }	 t d }
 |  i   } xq | D]i } t  i |  i  | } t i | | d | d	 |	 d
 |
 d |  i } | i |  i  |  i i |  q Wt i |  i  t d }	 t i d t d  } | d j o1 g  } | D] } | |  i | d  q]~ } n x t | |  D] \ } } t i | d t	 i
 | | | d | d	 |	 d d d d } | i |  i  | i |  |  i |  | i t   |  i i |  qW|  i |  i f S(   s  
        set the radial locations and labels of the r grids

        The labels will appear at radial distances radii at angle

        labels, if not None, is a len(radii) list of strings of the
        labels to use at each angle.

        if labels is None, the self.rformatter will be used

        rpad is a fraction of the max of radii which will pad each of
        the radial labels in the radial direction.

        Return value is a list of lines, labels where the lines are
        lines.Line2D instances and the labels are text.Text
        instances

        kwargs control the rgrid Text label properties:
        %(Text)s

        ACCEPTS: sequence of floats
        i    s&   radial grids must be strictly positiveg        i   s   grid.linestyles
   grid.colors   grid.linewidthR9   R;   R  R   s   xtick.colorR  s   xtick.labelsizeg     f@R  R  R  R  N(!   Rm   Rp   R  R0   RL  R   t   popallR6  R7  RM  R  R8  R7   RJ  R  R3   R   R   R  R   R"   R5  R
   R)  R,   R=  R   R*  R+  Ry  R  t   set_clip_onRo   (   RJ   RD  R'  t   anglet   rpadR\   RK  t   thetaR  R;   RT  RF  RB   Rc   R4  R$   R   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRB    sD    


 !
1 !s   %dg?c         K   s  t  i |  i  d \ } } t d } t d }	 t d }
 |  i   } t i d | |  i  } x| | D]t } t i |  i  | d t	 i
 } t i | | d | d |	 d	 |
 d
 |  i } | i |  i  |  i i |  qe Wt  i |  i  t d }	 t i d t d  } | | } | d j o) g  } | D] } | | | q/~ } n x t | |  D] \ } } t i | d t	 i
 | | d | d |	 d d d d } | i |  i  | i |  |  i |  | i t  |  i i |  q]W|  i |  i f S(   s  
        set the angles at which to place the theta grids (these
        gridlines are equal along the theta dimension).  angles is in
        degrees

        labels, if not None, is a len(angles) list of strings of the
        labels to use at each angle.

        if labels is None, the labels with be fmt%%angle

        frac is the fraction of the polar axes radius at which to
        place the label (1 is the edge).Eg 1.05 isd outside the axes
        and 0.95 is inside the axes

        Return value is a list of lines, labels where the lines are
        lines.Line2D instances and the labels are Text
        instances:

        kwargs are optional text properties for the labels
        %(Text)s
        ACCEPTS: sequence of floats
        i    s   grid.linestyles
   grid.colors   grid.linewidthg        g     f@R9   R;   R  R   s   xtick.colorR  s   xtick.labelsizeR  R  R  R  (   i    i    N(   R   RL  R4  R7   RJ  Rm   R7  R8  R  RM  R  R3   R   R   R  R   R"   R3  R
   R)  R,   R   R*  R+  Ry  R  RM  Ro   (   RJ   RC  R'  R8   R  R\   t   oxt   oyR  R;   RT  RF  RB   R  RP  Rc   R4  R$   R   R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRA    s>    


 !

) )c         C   s(   |  i  i   i   \ } } t | |  S(   s3   get the maximum radius in the view limits dimension(   R   R  R  RL  (   RJ   Rw  Rx  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRJ    s    c         C   s  |  i    p d  Sn | i d  |  i d  |  i i   |  i i   |  i i   } |  i i |  } |  i	 i
 i   \ } } } } t i   } xa t |  D]S \ }	 }
 |
 \ } } | | } |	 d j o | i | |  q | i | |  q W| i   |  i o" |  i o |  i i |  q.n |  i o` x+ |  i D]  } | i |  | i |  qBWx/ |  i D]  } | i |  | i |  qpWn x |  i D] } | i |  qWg  } | i |  i  | i |  i  | i |  i  | i |  i  | i |  i  g  } | D] } | | i | f q~ } | i    x! | D] \ } } | i |  qJWx% |  i! |  i" D] } | i |  qxW|  i# d  j	 o |  i# i |  n |  i% i |  |  i i&   |  i i&   | i' d  d  S(   Nt
   polar_axesi   i    ((   R  R  Rv  R   R  R   R/  R  Rf  R   R   R  R   t   path_storageR  t   move_tot   line_tot   close_polygonR3  R   R  R!  R6  t   set_clip_pathR4  R   R  R"  R   R   R$  R  R  R3  R5  R&  R,   R,  R  R  (   RJ   R  Rh  Rk  R   R@   R   R   t   clippathR  R  R%   RD   R  R$  R$   R  R  R  (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR    sd     
!

"

 
 
 *
  c         C   s   | t  i } d | | f S(   s0   return a format string formatting the coordinates   theta=%1.2fpi, r=%1.3f(   RM  R  (   RJ   RP  RB   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRL  I  s    c         C   s   t  |  i  t  |  i  S(   s2   return true if any artists have been added to axes(   R   R   R   (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  O  s    c         K   s   t  d   d S(   s   xlabel not implementeds'   xlabel not defined for polar axes (yet)N(   R  (   RJ   R|  R(  R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR}  S  s    c         K   s   t  d   d S(   s   ylabel not implementeds'   ylabel not defined for polar axes (yet)N(   R  (   RJ   R~  R(  R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  W  s    c         K   s   t  d   d S(   s   xlim not implementeds"   xlim not meaningful for polar axesN(   R  (   RJ   R   R   R   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   [  s    c         K   s   t  d   d S(   s   ylim not implementeds"   ylim not meaningful for polar axesN(   R  (   RJ   R   R   R   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   _  s    c         C   s   d S(   s   return the xaxis scale stringt   polar(    (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR  c  s    c         C   s   d S(   s   return the yaxis scale stringRZ  (    (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR/  g  s    c         C   s   d S(   s4   toggle between log and linear axes ignored for polarN(    (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR;  k  s    c         O   s   t  d   d S(   sO   
        TABLE(*args, **kwargs)
        Not implemented for polar axes
        s$   table not implemented for polar axesN(   R  (   RJ   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR   p  s    N("   R   R   R   R8  RK   R   R   R  R   RX  RG  R(  RE  Rs   R  R,   RB  R   R  R   R  RA  RJ  R  RL  R  R}  R  R   R   R  R/  R;  R   (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR,    s8   					P				B9		E					t   PolarSubplotc           B   s    e  Z d  Z d   Z d   Z RS(   s   
    subplot class for Polar Axes

    This is not normally instantiated by the user; instead,
    use the Figure.add_subplot(..., polar=True) method.
    c         C   s   d |  i  |  i f S(   Ns   PolarSubplot(%gx%g)(   RX  RY  (   RJ   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR     s    c         O   sE   t  i |  | |  t i |  | |  i |  i |  i |  i g |  d  S(   N(   R	  RK   R,  R  R  RX  RY  (   RJ   R   R#   R\   (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyRK     s    (   R   R   R   R   RK   (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pyR[  y  s   	(B   t
   __future__R    R   RM  t   sysRR  t   numpyRm   t   matplotlib.numerix.npymat   numerixt   npymaR   t
   matplotlibR7   R   R   R   R   R   R   R   R  R   R-   R   R  R	   R=  R
   R   R  R   R  R   R3   R   R   R   R   R   R  R   R  R   R*  R   R
  R   R   R   R   R)   R>   R?   R   R   R   R   R   R   R	  R+  R,  R[  t   kwdocR  (    (    (    s8   /Users/cmoad/workspace/matplotlib/lib/matplotlib/axes.pys   <module>   sx   $				#	E 	                    !