
 m[c           @` sC  d  d l  m Z m Z m Z m Z d  d l m Z d  d l Z d  d l m	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l m Z d  d l Z d  d l Z d  d l m Z d  d l m Z m Z m Z m Z m Z d  d l m Z d  d l j Z d  d l j Z d  d l  j! Z" d  d l# j$ Z% d  d l& j' Z( d  d l) j* Z+ d  d l, j- Z. d  d l/ j0 Z1 d  d l2 j3 Z4 d  d l5 j6 Z6 d  d l7 j8 Z9 d  d l: j; Z< d  d	 l= m> Z> d  d
 l# m? Z? d  d l@ mA ZA d  d lB mC ZC d  d lB mD ZD e jE ZE e jF ZF e jG ZG d ZH d   ZI d eJ f d     YZK d e% jL f d     YZM d S(   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literals(   t   OrderedDictN(   t   xrange(   t
   attrgetter(   t   cbook(   t	   _check_1dt   _string_to_boolt   iterablet   index_oft	   get_label(   t	   docstring(   t	   OffsetBox(   t   allow_rasterization(   t   Legend(   t   cycler(   t   validate_axisbelowu|   axes.hold is deprecated.
    See the API Changes document (http://matplotlib.org/api/api_changes.html)
    for more details.c   	      C` s  d } d } d } yf t j |   } y t t |    } Wn t k
 rW | | | f SX|  | k rq | | | f Sd } Wn t k
 r n X|  j d  d k r d } |  j d d  }  n  |  j d  d k r d } |  j d d  }  n  |  j d  d k rd } |  j d d  }  n  g  |  D] } | ^ q#} d } x=| t |  k  rz| | } | t	 j
 k r| d k	 rt d |    n  | } n | t	 j k r| d k	 rt d |    n  | } n | t j   k r| d k	 rt d	 |    n  | } nk | d
 k r]| t |  d k  r]t | | d  } t j d j |   } | d 7} n t d |   | d 7} q>W| d k r| d k rt d } n  | d k rd } n  | d k rd } n  | | | f S(   u	  
    Process a MATLAB 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
    * 'C2--': the third color in the color cycle, dashed lines

    .. seealso::

        :func:`~matplotlib.Line2D.lineStyles` and
        :func:`~matplotlib.pyplot.colors`
            for all possible styles and color format string.
    u   --i    u    u   -.u    u   Noneu1   Illegal format string "%s"; two linestyle symbolsu.   Illegal format string "%s"; two marker symbolsu-   Illegal format string "%s"; two color symbolsu   Ci   u   C{}u*   Unrecognized character %c in format stringu   lines.linestyleN(   t   Nonet   mcolorst   to_rgbat   strt   intt
   ValueErrort   findt   replacet   lent   mlinest
   lineStylest   lineMarkerst   get_named_colors_mappingt   formatt   rcParams(	   t   fmtt	   linestylet   markert   colort   fmtintt   ct   charst   it   color_cycle_number(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _process_plot_format3   sp    

			"		t   _process_plot_var_argsc           B` s   e  Z d  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 d   Z d   Z d   Z RS(   u3  
    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
    u   plotc         C` s    | |  _  | |  _ |  j   d  S(   N(   t   axest   commandt   set_prop_cycle(   t   selfR-   R.   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   __init__   s    		c         C` s   i |  j  d 6|  j d 6S(   Nu   axesu   command(   R-   R.   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   __getstate__   s    c         C` s   | j    |  _ |  j   d  S(   N(   t   copyt   __dict__R/   (   R0   t   state(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   __setstate__   s    c         O` sm   | p	 | s/ t  |  d k r< | d d  k r< t d } n t | |   } t j |  |  _ | j |  _ d  S(   Ni   i    u   axes.prop_cycle(	   R   R   R!   R   t	   itertoolst   cyclet   prop_cyclert   keyst
   _prop_keys(   R0   t   argst   kwargsR9   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR/      s
    /c         O` s  |  j  j d  k	 r|  j  j d  k	 r| j d |  j  j j  } |  j  j d k rf | j d |  } n  | j d |  j  j j  } |  j  j d k r | j d |  } n  | |  j  j j k r |  j  j j |  n  | |  j  j j k r|  j  j j |  qn  |  j | |   } | S(   Nu   xunitsu   polaru
   thetaunitsu   yunitsu   runits(	   R-   t   xaxisR   t   yaxist   popt   unitst   namet	   set_unitst   _grab_next_args(   R0   R<   R=   t   xunitst   yunitst   ret(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   __call__   s    $c         C` s$   d |  j  k r d St |  j  d S(   u#   Return the next color in the cycle.u   coloru   k(   R;   t   nextR9   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_next_color   s    c         K` s,   |  j  d k s t d   | j |   d  S(   Nu   plotu$   set_lineprops only works with "plot"(   R.   t   AssertionErrort   set(   R0   t   lineR=   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_lineprops   s    c         K` s,   |  j  d k s t d   | j |   d  S(   Nu   fillu%   set_patchprops only works with "fill"(   R.   RK   RL   (   R0   t	   fill_polyR=   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_patchprops   s    c         C` s  |  j  j d  k	 r |  j  j d  k	 r |  j  j j |  } |  j  j j |  } |  j d k r | rx |  j  j |  } n  | r |  j  j |  } q q n  t |  } t |  } | j	 d | j	 d k r t
 d j | j	 | j	    n  | j d k s
| j d k r+t
 d j | j	 | j	    n  | j d k rV| d  d   t j f } n  | j d k r| d  d   t j f } n  | | f S(   Nu   ploti    uA   x and y must have same first dimension, but have shapes {} and {}i   u=   x and y can be no greater than 2-D, but have shapes {} and {}i   (   R-   R>   R   R?   t   update_unitsR.   t   convert_xunitst   convert_yunitsR   t   shapeR   R    t   ndimt   npt   newaxis(   R0   t   xt   yt   bxt   by(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _xy_from_xy   s*    $		c         ` s   |  j  } | d k r! t   } n  | | } t   f d   | D  r t |  j  j   } x' | D] } | j | d  qc Wn i  } | S(   u!  
        Only advance the cycler if the cycler has information that
        is not specified in any of the supplied tuple of dicts.
        Ignore any keys specified in the `ignore` set.

        Returns a copy of defaults dictionary if there are any
        keys that are not found in any of the supplied dictionaries.
        If the supplied dictionaries have non-None values for
        everything the property cycler has, then just return
        an empty dictionary. Ignored keys are excluded from the
        returned dictionary.

        c         3` s+   |  ]!   t    f d     D  Vq d S(   c         3` s'   |  ] } | j    d   d  k Vq d  S(   N(   t   getR   (   t   .0t   kw(   t   k(    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pys	   <genexpr>  s    N(   t   all(   R^   (   R=   (   R`   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pys	   <genexpr>  s   N(   R;   R   RL   t   anyRI   R9   R3   R@   (   R0   t   ignoreR=   t	   prop_keyst   default_dictt   p(    (   R=   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _getdefaults   s    	
c         ` sS   xL | D]D   t    f d   | D  r x | D] } |   |   <q0 Wq q Wd S(   u   
        Given a defaults dictionary, and any other dictionaries,
        update those other dictionaries with information in defaults if
        none of the other dictionaries contains that information.

        c         3` s'   |  ] } | j    d   d  k Vq d  S(   N(   R]   R   (   R^   R_   (   R`   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pys	   <genexpr>#  s    N(   Ra   (   R0   t   defaultsR=   R_   (    (   R`   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _setdefaults  s    c         C` sT   | j    } | j |  |  j d  |  } |  j | |  t j | | |  } | S(   N(   R3   t   updateRg   R   Ri   R   t   Line2D(   R0   RX   RY   R_   R=   Re   t   seg(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   _makeline'  s    c      	   C` s7  | j    } | j    } d d d d d h } x9 t j |  D]( \ } } | d  k	 r= | j |  q= q= W|  j | |  } |  j | |  | j d d   }	 | j d d   |  j | |  t	 j
 t j | d  d   t j f | d  d   t j f f  d |	 d | j d	 t  d
 | d }
 |  j |
 |  |
 S(   Nu   markeru
   markersizeu   markeredgecoloru   markerfacecoloru   markeredgewidthu   colort	   facecolort   fillu   fillt   closedu   closed(   R3   t   sixt	   iteritemsR   t   addRg   Ri   R]   R@   t   mpatchest   PolygonRV   t   hstackRW   t   TrueRP   (   R0   RX   RY   R_   R=   t   ignoresR`   t   vRe   Rn   Rl   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   _makefill/  s&    
	"c         C` s  g  } t  |  d k rT t | d t j  rT t | d  \ } } } | d  } n0 t  |  d k ru t d   n d \ } } } t d   | D  r t d   n  i  } x? t d | | | f  D]% \ } }	 |	 d  k	 r |	 | | <q q Wd
 | k s| d
 d  k r't	 | d d   | d
 <n  t  |  d k r\t
 | d  }
 t
 | d  } n t | d  \ }
 } |  j |
 |  \ }
 } |  j d k r|  j } n | j d t  | d <|  j } |
 j d | j d } } | d k r| d k r| | k rt j d d  n  xg t t | |   D]P } | |
 d  d   | | f | d  d   | | f | |  } | j |  q,W| S(   Ni   ii   u!   third arg must be a format stringc         s` s   |  ] } | d  k Vq d  S(   N(   R   (   R^   Ry   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pys	   <genexpr>m  s    u   x and y must not be Noneu	   linestyleu   markeru   coloru   labeli   i    u   plotu   closedu   2.2uG   cycling among columns of inputs with non-matching shapes is deprecated.(   NNN(   u	   linestyleu   markeru   color(   R   t
   isinstanceRq   t   string_typesR+   R   R   Rb   t   zipR   R   R   R\   R.   Rm   R]   Rw   Rz   RT   R   t   warn_deprecatedR   t   maxt   append(   R0   t   tupR=   RG   R#   R$   R%   R_   R`   Ry   RX   RY   t   funct   ncxt   ncyt   jRl   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   _plot_args`  s@    (		$=c         o` s   x{ | r} | d  | d } } | rX t  | d t j  rX | | d f 7} | d } n  x |  j | |  D] } | Vqk Wq Wd  S(   Ni   i    i   (   R{   Rq   R|   R   (   R0   R<   R=   t   thisRl   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRD     s    	(   t   __name__t
   __module__t   __doc__R1   R2   R6   R/   RH   RJ   RN   RP   R\   Rg   Ri   Rm   Rz   R   RD   (    (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR,      s    			
					(				1	0t	   _AxesBasec        	   B` s  e  Z d  Z d Z e j   Z e j   Z e j   Z d   Z	 e
 j d d j g  e j   D] Z e e  ^ q[   d e d d d d d d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d d  Z d   Z d   Z d d  Z d   Z d   Z d   Z  e! d  Z" d d  Z# d d  Z$ d   Z% d   Z& d   Z' d   Z( d   Z) d d d d   Z* d!   Z+ e, e j- d" d# d$ d%     Z. d&   Z/ d'   Z0 e0 Z1 d(   Z2 e2 Z3 d)   Z4 d*   Z5 e j- d+ d# d, d-    Z6 e j- d.  d/    Z7 e j- d. d0 e8 d d1   Z9 d2   Z: d d e! d3  Z; d4   Z< e! d5  Z= d6   Z> e! d7  Z? d8   Z@ d9   ZA d d:  ZB d;   ZC d<   ZD d=   ZE d>   ZF d?   ZG d@   ZH dA   ZI dB   ZJ dC   ZK dD   ZL dE   ZM dF   ZN dG   ZO dH   ZP e dI  ZQ dJ   ZR dK   ZS dL   ZT dM   ZU dN   ZV dO   ZW dP   ZX dQ   ZY dR   ZZ e! e! dS  Z[ e! dT  Z\ e e dU  Z] dV   Z^ d d d dW  Z_ dX   Z` dY   Za dZ   Zb d[   Zc d\   Zd d]   Ze d^   Zf e, d_    Zg eg jh d`    Zg da   Zi db   Zj dc   Zk dd   Zl de   Zm e d d df  Zn d e e dg  Zo dh   Zp eq d e! di   Zr dj   Zs dk   Zt dl   Zu dm   Zv dn   Zw do   Zx dp   Zy e
 jz d dq d dr   Z{ ds   Z| d d dt  Z} d du  Z~ dv   Z dw   Z dx   Z dy   Z dz   Z d d d{  Z d|   Z d}   Z d d e e! d~  Z d   Z d d j e j    e _ d   Z e! d  Z e! d  Z d   Z d   Z e! d d  Z d e! d  Z d   Z d   Z d   Z d d d  Z d   Z d d e e! d  Z d   Z d d j e j    e _ d   Z e! d  Z e! d  Z d   Z d   Z e! d d  Z d e! d  Z d d  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 d   Z d   Z d d e! e! d  Z d   Z d   Z d   Z e j- d"  d    Z e j- d"  d    Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z RS(   u   
    u   rectilinearc         C` s   d j  t |   j |  j j  S(   Nu(   {0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})(   R    t   typeR   t	   _positiont   bounds(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   __str__  s    t   scaleu    | u    c
         ` s)  t  j j    t | t j  r. |   _ n t j j |     _   j j d k  sg   j j	 d k  rv t
 d   n    j j     _     _ d   _ d   _ d   _ |   _ |   _ | d( k	 r   j j   |  n  | d( k	 r  j j   |  n    j |    j |    j |
 j d d(     j     _   j   | d( k rgt d } n  |   _ |   _  t d   _! d(   _" t d	   _#   j# d( k rt$   _# n  i    _%   j&   d(   _' d(   _( d(   _)   j* t$    j+ d(  | r  j, |  n  |	 r+  j- |	  n  t. |
  rG  j/ |
  n    j0 d( k	 r}  j0 j1 j2 d
   f d      _3 n    j4 d( k	 r  j4 j1 j2 d
   f d      _5 n    j6 d t d ot d d t d ot d d t d ot d d t d o	t d d t d ot d d t d o1t d d t d oEt d d t d  oYt d d! d"  	  j6 d t d o}t d# d t d ot d$ d t d ot d# d t d ot d$ d t d ot d% d t d ot d& d t d ot d% d t d  o	t d& d! d'  	d(   _7 d(   _8 d( S()   u	  
        Build an `~axes.Axes` instance in
        `~matplotlib.figure.Figure` *fig* with
        *rect=[left, bottom, width, height]* in
        `~matplotlib.figure.Figure` coordinates

        Optional keyword arguments:

          ================   =========================================
          Keyword            Description
          ================   =========================================
          *adjustable*       [ 'box' | 'datalim' ]
          *alpha*            float: the alpha transparency (can be None)
          *anchor*           [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N',
                               'NW', 'W' ]
          *aspect*           [ 'auto' | 'equal' | aspect_ratio ]
          *autoscale_on*     bool; whether to autoscale the *viewlim*
          *axisbelow*        [ bool | 'line' ] draw the grids
                             and ticks below or above most other artists,
                             or below lines but above patches
          *cursor_props*     a (*float*, *color*) tuple
          *figure*           a :class:`~matplotlib.figure.Figure`
                             instance
          *frame_on*         bool; whether to draw the axes frame
          *label*            the axes label
          *navigate*         bool
          *navigate_mode*    [ 'PAN' | 'ZOOM' | None ] the navigation
                             toolbar button status
          *position*         [left, bottom, width, height] in
                             class:`~matplotlib.figure.Figure` coords
          *sharex*           an class:`~matplotlib.axes.Axes` instance
                             to share the x-axis with
          *sharey*           an class:`~matplotlib.axes.Axes` instance
                             to share the y-axis with
          *title*            the title string
          *visible*          bool, whether the axes is visible
          *xlabel*           the xlabel
          *xlim*             (*xmin*, *xmax*) view limits
          *xscale*           [%(scale)s]
          *xticklabels*      sequence of strings
          *xticks*           sequence of floats
          *ylabel*           the ylabel strings
          *ylim*             (*ymin*, *ymax*) view limits
          *yscale*           [%(scale)s]
          *yticklabels*      sequence of strings
          *yticks*           sequence of floats
          ================   =========================================
        i    u/   Width and height specified must be non-negativeu   autou   boxu   Cu   axes_locatoru   axes.facecoloru   axes.axisbelowu	   axes.holdu   units finalizec           ` s     j  d t  S(   Nt   scalex(   t   _on_units_changedRw   (    (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   <lambda>!  s    c           ` s     j  d t  S(   Nt   scaley(   R   Rw   (    (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   %  s    t   topu	   xtick.topu   xtick.minor.topt   bottomu   xtick.bottomu   xtick.minor.bottomt   labeltopu   xtick.labeltopt   labelbottomu   xtick.labelbottomt   leftu
   ytick.leftu   ytick.minor.leftt   rightu   ytick.rightu   ytick.minor.rightt	   labelleftu   ytick.labelleftt
   labelrightu   ytick.labelrightt   whichu   minoru   xtick.major.topu   xtick.major.bottomu   ytick.major.leftu   ytick.major.rightu   majorN(9   t   martistt   ArtistR1   R{   t   mtransformst   BboxR   t   from_boundst   widtht   heightR   t   frozent   _originalPositionR-   t   _aspectt   _adjustablet   _anchort   _sharext   _shareyR   t   _shared_x_axest   joint   _shared_y_axest	   set_labelt
   set_figuret   set_axes_locatorR]   t   _gen_axes_spinest   spinest
   _init_axisR!   t
   _facecolort   _frameont
   _axisbelowt   _rasterization_zordert   _holdRw   t
   _connectedt   clat	   fmt_xdatat	   fmt_ydatat   _cachedRenderert   set_navigatet   set_navigate_modet
   set_xscalet
   set_yscaleR   Rj   R>   t	   callbackst   connectt   _xcidR?   t   _ycidt   tick_paramst
   _layoutboxt   _poslayoutbox(   R0   t   figt   rectRn   t   frameont   sharext   shareyt   labelt   xscalet   yscaleR=   (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR1     s    =$						
				
				







	







	c         C` s=   t  t |   j   } d  | d <| j d  | j d  | S(   Nu   _cachedRendereru
   _layoutboxu   _poslayoutbox(   t   superR   R2   R   R@   (   R0   R5   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR2   H  s
    
c         C` sw   | |  _  xL d d d d d d g D]2 } t |  |  } x | D] } | j | _ q> Wq" Wt |  _ d  |  _ d  |  _ d  S(   Nu   linesu   collectionsu   tablesu   patchesu   textsu   images(	   R4   t   getattrt   removet   _remove_methodRw   t   _staleR   R   R   (   R0   R5   t   container_namet	   containert   artist(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR6   R  s    			c         O` sb   |  j  } |  j j   } |  j j   } t j | j | | j | g | j | | j	 | g g  S(   uc   
        get the axes bounding box in display space; *args* and
        *kwargs* are empty
        (
   t   bboxR>   t   get_tick_paddingR?   R   R   t   x0t   y0t   x1t   y1(   R0   R<   R=   R   t   x_padt   y_pad(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_window_extent^  s
    	c         C` s   t  j |   |  _ |  j d j |  j  |  j d j |  j  t  j |   |  _ |  j d j |  j  |  j d j |  j  |  j   d S(   uA   move this out of __init__ because non-separable axes don't use itu   bottomu   topu   leftu   rightN(   t   maxist   XAxisR>   R   t   register_axist   YAxisR?   t   _update_transScale(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   i  s    c         C` sx   t  j j |  |  t j |  j | j  |  _ t j j	   |  _
 t j j   |  _ t j t j    |  _ |  j   d S(   u   
        Set the `.Figure` for this `.Axes`.

        .. ACCEPTS: `.Figure`

        Parameters
        ----------
        fig : `.Figure`
        N(   R   R   R   R   t   TransformedBboxR   t   transFigureR   R   t   nullt   dataLimt   unitt   viewLimt   TransformWrappert   IdentityTransformt
   transScalet   _set_lim_and_transforms(   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   s  s    
c         C` s   t  j |  j  |  _ t  j t  j    |  _ t  j t  j |  j	 |  j   |  _
 |  j |  j
 |  j |  _ t  j |  j |  j  |  _ t  j |  j |  j  |  _ d S(   u  
        set the *_xaxis_transform*, *_yaxis_transform*,
        *transScale*, *transData*, *transLimits* and *transAxes*
        transformations.

        .. note::

            This method is primarily used by rectilinear projections
            of the :class:`~matplotlib.axes.Axes` class, and is meant
            to be overridden by new kinds of projection axes that need
            different transformations and limits. (See
            :class:`~matplotlib.projections.polar.PolarAxes` for an
            example.

        N(   R   t   BboxTransformToR   t	   transAxesR   R   R   t   BboxTransformFromR   R   t   transLimitst	   transDatat   blended_transform_factoryt   _xaxis_transformt   _yaxis_transform(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    u   gridc         C` s]   | d k r |  j  S| d k r0 |  j d j   S| d k rM |  j d j   St d   d S(   u  
        Get the transformation used for drawing x-axis labels, ticks
        and gridlines.  The x-direction is in data coordinates and the
        y-direction is in axis coordinates.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   gridu   tick1u   bottomu   tick2u   topu   unknown value for whichN(   R   R   t   get_spine_transformR   (   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xaxis_transform  s    c         C` sG   t  j d } |  j d d  t j d d | d |  j j  d | f S(   u  
        Get the transformation used for drawing x-axis labels, which
        will add the given amount of padding (in points) between the
        axes and the label.  The x-direction is in data coordinates
        and the y-direction is in axis coordinates.  Returns a
        3-tuple of the form::

          (transform, valign, halign)

        where *valign* and *halign* are requested alignments for the
        text.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   xtick.alignmentR   u   tick1i    ig      R@u   top(   t
   matplotlibR!   R   R   t   ScaledTranslationt   figuret   dpi_scale_trans(   R0   t
   pad_pointst   labels_align(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xaxis_text1_transform  s
    c         C` sC   t  j d } |  j d d  t j d | d |  j j  d | f S(   u  
        Get the transformation used for drawing the secondary x-axis
        labels, which will add the given amount of padding (in points)
        between the axes and the label.  The x-direction is in data
        coordinates and the y-direction is in axis coordinates.
        Returns a 3-tuple of the form::

          (transform, valign, halign)

        where *valign* and *halign* are requested alignments for the
        text.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   xtick.alignmentR   u   tick2i    g      R@u   bottom(   R   R!   R   R   R   R   R   (   R0   R   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xaxis_text2_transform  s
    c         C` s]   | d k r |  j  S| d k r0 |  j d j   S| d k rM |  j d j   St d   d S(   u  
        Get the transformation used for drawing y-axis labels, ticks
        and gridlines.  The x-direction is in axis coordinates and the
        y-direction is in data coordinates.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   gridu   tick1u   leftu   tick2u   rightu   unknown value for whichN(   R   R   R   R   (   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yaxis_transform   s    c         C` sG   t  j d } |  j d d  t j d | d d |  j j  | d f S(   u  
        Get the transformation used for drawing y-axis labels, which
        will add the given amount of padding (in points) between the
        axes and the label.  The x-direction is in axis coordinates
        and the y-direction is in data coordinates.  Returns a 3-tuple
        of the form::

          (transform, valign, halign)

        where *valign* and *halign* are requested alignments for the
        text.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   ytick.alignmentR   u   tick1ig      R@i    u   right(   R   R!   R  R   R   R   R   (   R0   R   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yaxis_text1_transform  s
    c         C` sC   t  j d } |  j d d  t j | d d |  j j  | d f S(   u  
        Get the transformation used for drawing the secondary y-axis
        labels, which will add the given amount of padding (in points)
        between the axes and the label.  The x-direction is in axis
        coordinates and the y-direction is in data coordinates.
        Returns a 3-tuple of the form::

          (transform, valign, halign)

        where *valign* and *halign* are requested alignments for the
        text.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        u   ytick.alignmentR   u   tick2g      R@i    u   left(   R   R!   R  R   R   R   R   (   R0   R   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yaxis_text2_transform4  s
    c         C` s}   |  j  j t j |  j j   |  j j     t |  d  ry x9 |  j D]+ } y | j	 j
   WqG t k
 rq qG XqG Wn  d  S(   Nu   lines(   R   RL   R   R   R>   t   get_transformR?   t   hasattrt   linest   _transformed_patht
   invalidatet   AttributeError(   R0   RM   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   P  s    	c         C` s$   | r |  j  j   S|  j j   Sd S(   ue  
        Get a copy of the axes rectangle as a `.Bbox`.

        Parameters
        ----------
        original : bool
            If ``True``, return the original position. Otherwise return the
            active position. For an explanation of the positions see
            `.set_position`.

        Returns
        -------
        pos : `.Bbox`

        N(   R   R   R   (   R0   t   original(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_position[  s    u   bothc         C` s)   |  j  | d d d |  _ d |  _ d S(   u  
        Set the axes position.

        Axes have two position attributes. The 'original' position is the
        position allocated for the Axes. The 'active' position is the
        position the Axes is actually drawn at. These positions are usually
        the same unless a fixed aspect is set to the Axes. See `.set_aspect`
        for details.

        Parameters
        ----------
        pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox`
            The new position of the in `.Figure` coordinates.

        which : ['both' | 'active' | 'original'], optional
            Determines which position variables to change.

        R   u   bothN(   t   _set_positionR   R   R   (   R0   t   posR   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_positionp  s    	c         C` s   t  | t j  s' t j j |   } n  xX |  j j |   D]D } | d k r_ | j j |  n  | d k r: | j	 j |  q: q: Wt
 |  _ d S(   u   
        private version of set_position.  Call this internally
        to get the same functionality of `get_position`, but not
        to take the axis out of the constrained_layout
        hierarchy.
        u   bothu   activeu   originalN(   u   bothu   active(   u   bothu   original(   R{   R   t   BboxBaseR   R   t   _twinned_axest   get_siblingsR   RL   R   Rw   t   stale(   R0   R  R   t   ax(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    c         C` sF   x? |  j  j |   D]+ } | j d t  } | j | d d q Wd S(   u   
        Reset the active position to the original position.

        This resets the a possible position change due to aspect constraints.
        For an explanation of the positions see `.set_position`.
        R  R   u   activeN(   R  R  R  Rw   R  (   R0   R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   reset_position  s    c         C` s   | |  _  t |  _ d S(   u<  
        Set the axes locator.

        .. ACCEPTS: a callable object which takes an axes instance and
           renderer and returns a bbox.

        Parameters
        ----------
        locator : callable
            A locator function, which takes an axes and a renderer and returns
            a bbox.
        N(   t   _axes_locatorRw   R  (   R0   t   locator(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    	c         C` s   |  j  S(   u*   
        Return the axes_locator.
        (   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_axes_locator  s    c         C` sX   | j  |  j  | j   s/ | j |  j  n  |  | _ | j rT |  j j |  n  d S(   u3   set the boilerplate props for artists added to axesN(	   R   R   t   is_transform_sett   set_transformR   R-   t	   mouseovert   mouseover_setRs   (   R0   t   a(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _set_artist_props  s    		c         C` s   t  j d d d  S(   u]  
        Returns the patch used to draw the background of the axes.  It
        is also used as the clipping path for any data elements on the
        axes.

        In the standard axes, this is a rectangle, but in other
        projections it may not be.

        .. note::

            Intended to be overridden by new projection types.

        g        g      ?(   g        g        (   Rt   t	   Rectangle(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _gen_axes_patch  s    g        u   inchesc         C` sj   t  d t j j |  d  f d t j j |  d  f d t j j |  d  f d t j j |  d  f g  S(   ui  
        Returns a dict whose keys are spine names and values are
        Line2D or Patch instances. Each element is used to draw a
        spine of the axes.

        In the standard axes, this is a single line segment, but in
        other projections it may not be.

        .. note::

            Intended to be overridden by new projection types.

        u   leftu   rightu   bottomu   top(   R   t   mspinest   Spinet   linear_spine(   R0   t	   locationst   offsetRA   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s
    c         C` s  t  |  d  r! |  j j   } n t } |  j j   } |  j j   } |  j j   |  j j   x* t j |  j	  D] \ } } | j   qr Wt |  _
 t j   |  _ |  j d% k	 r8|  j j j |  j _ |  j j j |  j _ |  j j   \ } } |  j | | d t d d% t j |  j j j   |  j  |  j _ n8 |  j j d  y |  j d d  Wn t k
 ron X|  j d% k	 r|  j j j |  j _ |  j j j |  j _ |  j j   \ } }	 |  j | |	 d t d d% t j |  j j j   |  j  |  j _ n8 |  j j d  y |  j d d  Wn t k
 r;n Xt d r_|  j j t  j!    n  t d r|  j j t  j!    n  t |  _" t |  _# t d	 |  _$ t d
 |  _% d% |  _& t |  _' |  j(   t) |   |  _* t) |  d  |  _+ t d |  _, g  |  _- g  |  _. g  |  _/ g  |  _0 g  |  _1 g  |  _2 t3   |  _4 d% |  _5 d% |  _6 g  |  _7 g  |  _8 |  j9 t  |  j9 |  j, d t d d t d t: j; d t d d t d  }
 t< j= d d d d d d d |
 d d d d  |  _> t< j= d d  d d d d d |
 j?   d d d d!  |  _@ t< j= d d d d d d d |
 j?   d d d d"  |  _A t d# } |  jB |  x- |  j> |  j@ |  jA f D] } |  jC |  qW|  jD   |  _ |  j jE |  jF  |  j jG |  jH  |  j jI d$  |  j jJ d  |  j jK |  jL  |  jM   |  j jN |  j  |  j jN |  j  |  jO jP   |  jQ jP   |  j ry|  j jR |  |  j jR |  n  |  j r|  j jR |  |  j jR |  n  t |  _S d% S(&   u   Clear the current axes.u   patcht   emitt   autou   lineari    i   u   xtick.minor.visibleu   ytick.minor.visibleu   axes.xmarginu   axes.ymarginu   fillu	   axes.gridR   u   axes.grid.whicht   axisu   axes.grid.axist   sizeu   axes.titlesizet   weightu   axes.titleweightRX   g      ?RY   g      ?t   textu    t   fontpropertiest   verticalalignmentu   baselinet   horizontalalignmentu   centerg        u   leftu   rightu   axes.titlepadu   NoneN(T   R  t   patcht   get_visibleRw   R>   R?   R   Rq   Rr   R   t   ignore_existing_data_limitsR   t   CallbackRegistryR   R   R   t   majort   minort   get_xlimt   set_xlimt   Falset   mscalet   scale_factoryt	   get_scalet   _scalet
   _set_scalet	   TypeErrorR   t   get_ylimt   set_ylimR!   t   set_minor_locatort   mtickert   AutoMinorLocatort   _autoscaleXont   _autoscaleYont   _xmargint   _ymargint   _tightt   _use_sticky_edgesR   R,   t
   _get_linest   _get_patches_for_fillt   _gridOnR	  t   patchest   textst   tablest   artistst   imagesRL   R  t   _current_imaget   legend_t   collectionst
   containerst   gridt   font_managert   FontPropertiest   mtextt   Textt   titleR3   t   _left_titlet   _right_titlet   _set_title_offset_transR   R"  R   R   t   set_facecolorR   t   set_edgecolort   set_linewidthR  R   t   set_axis_ont   set_clip_pathR   t   cleanR   t   set_visibleR  (   R0   t   patch_visiblet   xaxis_visiblet   yaxis_visibleRB   t   spineR   R   R   R   t   propst   title_offset_pointst   _title(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    	$$

				
											
			

		u   2.1t   alternativeu
   Axes.patchc         C` s   |  j  S(   N(   R1  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   axesPatchu  s    c         C` s   |  j    d S(   u   Clear the axes.N(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   clearz  s    c         C` s   |  j  j   S(   u   Get the Axes facecolor.(   R1  t   get_facecolor(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRq  ~  s    c         C` s"   | |  _  t |  _ |  j j |  S(   ux   Set the Axes facecolor.

        .. ACCEPTS: color

        Parameters
        ----------
        color : color
        (   R   Rw   R  R1  R`  (   R0   R%   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR`    s    			c         C` sm   t  j d | d |  j j  |  _ xD |  j |  j |  j f D]* } | j |  j	 |  j  | j
 d  q; Wd S(   u}   
        Set the offset for the title either from rcParams['axes.titlepad']
        or from set_title kwarg ``pad``.
        g        g      R@N(   R   R   R   R   t   titleOffsetTransR\  R]  R^  R  R   t   set_clip_boxR   (   R0   Rl  Rm  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR_    s    
c         O` sy   | r | r t  d   n  t |  d k rF | d d k rF d } n t | |   } |  j j |  |  j j |  d S(   ut	  
        Set the property cycle of the Axes.

        The property cycle controls the style properties such as color,
        marker and linestyle of future plot commands. The style properties
        of data already added to the Axes are not modified.

        Call signatures::

          set_prop_cycle(cycler)
          set_prop_cycle(label=values[, label2=values2[, ...]])
          set_prop_cycle(label, values)

        Form 1 sets given `~cycler.Cycler` object.

        Form 2 creates a `~cycler.Cycler` which cycles over one or more
        properties simultaneously and set it as the property cycle of the
        axes. If multiple properties are given, their value lists must have
        the same length. This is just a shortcut for explicitly creating a
        cycler and passing it to the function, i.e. it's short for
        ``set_prop_cycle(cycler(label=values label2=values2, ...))``.

        Form 3 creates a `~cycler.Cycler` for a single property and set it
        as the property cycle of the axes. This form exists for compatibility
        with the original `cycler.cycler` interface. Its use is discouraged
        in favor of the kwarg form, i.e. ``set_prop_cycle(label=values)``.

        Parameters
        ----------
        cycler : Cycler
            Set the given Cycler. *None* resets to the cycle defined by the
            current style.

        label : str
            The property key. Must be a valid `.Artist` property.
            For example, 'color' or 'linestyle'. Aliases are allowed,
            such as 'c' for 'color' and 'lw' for 'linewidth'.

        values : iterable
            Finite-length iterable of the property values. These values
            are validated and will raise a ValueError if invalid.

        Examples
        --------
        Setting the property cycle for a single property:

        >>> ax.set_prop_cycle(color=['red', 'green', 'blue'])

        Setting the property cycle for simultaneously cycling over multiple
        properties (e.g. red circle, green plus, blue cross):

        >>> ax.set_prop_cycle(color=['red', 'green', 'blue'],
        ...                   marker=['o', '+', 'x'])

        See Also
        --------
        matplotlib.rcsetup.cycler
            Convenience function for creating validated cyclers for properties.
        cycler.cycler
            The original function for creating unvalidated cyclers.

        uC   Cannot supply both positional and keyword arguments to this method.i   i    N(   R?  R   R   R   RK  R/   RL  (   R0   R<   R=   t
   prop_cycle(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR/     s    ?"	u   1.5u   `.set_prop_cycle`c         C` s0   | d k r |  j d  n |  j d |  d S(   u   
        Set the color cycle for any future plot commands on this Axes.

        Parameters
        ----------
        clist
            A list of mpl color specifiers.
        u   colorN(   R   R/   (   R0   t   clist(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_color_cycle  s    
u   2.0c         C` s   |  j  S(   u|   return the HOLD status of the axes

        The `hold` mechanism is deprecated and will be removed in
        v3.0.
        (   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   ishold  s    t   messagec         C` s)   | d k r |  j |  _ n	 | |  _ d S(   u  
        Set the hold state.

        The ``hold`` mechanism is deprecated and will be removed in
        v3.0.  The behavior will remain consistent with the
        long-time default value of True.

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

        Examples::

          # toggle hold
          hold()

          # turn hold on
          hold(True)

          # turn hold off
          hold(False)

        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   (   R0   t   b(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   hold  s    c         C` s   |  j  S(   N(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_aspect#  s    c         C` s   t  | t j  o | d k s- t |  } n  | r^ t |  j j |   |  j j |    } n	 |  g } x | D] } | | _ qn W| d k r |  j
 } n  |  j | d | | d k	 r |  j | d | n  t |  _ d S(   u  
        Set the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit.

        Parameters
        ----------
        aspect : ['auto' | 'equal'] or num
            Possible values:

            ========   ================================================
            value      description
            ========   ================================================
            'auto'     automatic; fill the position rectangle with data
            '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 : None or ['box' | 'datalim'], optional
            If not ``None``, this defines which parameter will be adjusted to
            meet the required aspect. See `.set_adjustable` for further
            details.

        anchor : None or str or 2-tuple of float, optional
            If not ``None``, this defines where the Axes will be drawn if there
            is extra space due to aspect constraints. The most common way to
            to specify the anchor are abbreviations of cardinal directions:

            =====   =====================
            value   description
            =====   =====================
            'C'     centered
            'SW'    lower left corner
            'S'     middle of bottom edge
            'SE'    lower right corner
            etc.
            =====   =====================

            See `.set_anchor` for further details.

        share : bool, optional
            If ``True``, apply the settings to all shared Axes.
            Default is ``False``.

        See Also
        --------
        matplotlib.axes.Axes.set_adjustable
            defining the parameter to adjust in order to meet the required
            aspect.
        matplotlib.axes.Axes.set_anchor
            defining the position in case of extra space.
        u   equalu   autot   shareN(   u   equalu   auto(   R{   Rq   R|   t   floatRL   R   R  R   R   R   R   t   set_adjustablet
   set_anchorRw   R  (   R0   t   aspectt
   adjustablet   anchorR|  R-   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   set_aspect&  s    5	c         C` s   |  j  S(   N(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_adjustablen  s    c         C` s   | d k r" t  j d t j  n  | d k r= t d   n  | rn t |  j j |   |  j j |    } n	 |  g } x | D] } | | _	 q~ Wt
 |  _ d S(   u  
        Define which parameter the Axes will change to achieve a given aspect.

        Parameters
        ----------
        adjustable : ['box' | 'datalim']
            If 'box', change the physical dimensions of the Axes.
            If 'datalim', change the ``x`` or ``y`` data limits.

        share : bool, optional
            If ``True``, apply the settings to all shared Axes.
            Default is ``False``.

        .. ACCEPTS: [ 'box' | 'datalim']

        See Also
        --------
        matplotlib.axes.Axes.set_aspect
            for a description of aspect handling.

        Notes
        -----
        Shared Axes (of which twinned Axes are a special case)
        impose restrictions on how aspect ratios can be imposed.
        For twinned Axes, use 'datalim'.  For Axes that share both
        x and y, use 'box'.  Otherwise, either 'datalim' or 'box'
        may be used.  These limitations are partly a requirement
        to avoid over-specification, and partly a result of the
        particular implementation we are currently using, in
        which the adjustments for aspect ratios are done sequentially
        and independently on each Axes as it is drawn.
        u
   box-forcedu:   The 'box-forced' keyword argument is deprecated since 2.2.u   boxu   datalimu$   argument must be 'box', or 'datalim'N(   u   boxu   datalimu
   box-forced(   t   warningst   warnR   t   mplDeprecationR   RL   R   R  R   R   Rw   R  (   R0   R  R|  R-   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR~  q  s    !		c         C` s   |  j  S(   u   
        Get the anchor location.

        See Also
        --------
        matplotlib.axes.Axes.set_anchor
            for a description of the anchor.
        matplotlib.axes.Axes.set_aspect
            for a description of aspect handling.
        (   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_anchor  s    c         C` s   | t  j j k p! t |  d k sF t d d j t  j j    n  | rw t |  j j |   |  j	 j |    } n	 |  g } x | D] } | | _
 q Wt |  _ d S(   u  
        Define the anchor location.

        The actual drawing area (active position) of the Axes may be smaller
        than the Bbox (original position) when a fixed aspect is required. The
        anchor defines where the drawing area will be located within the
        available space.

        .. ACCEPTS: [ 'C' | 'SW' | 'S' | 'SE' | 'E' | 'NE' | 'N' | 'NW' | 'W' ]

        Parameters
        ----------
        anchor : str or 2-tuple of floats
            The anchor position may be either:

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

            - a string using cardinal directions as abbreviation:

              - 'C' for centered
              - 'S' (south) for bottom-center
              - 'SW' (south west) for bottom-left
              - etc.

              Here is an overview of the possible positions:

              +------+------+------+
              | 'NW' | 'N'  | 'NE' |
              +------+------+------+
              | 'W'  | 'C'  | 'E'  |
              +------+------+------+
              | 'SW' | 'S'  | 'SE' |
              +------+------+------+

        share : bool, optional
            If ``True``, apply the settings to all shared Axes.
            Default is ``False``.

        See Also
        --------
        matplotlib.axes.Axes.set_aspect
            for a description of aspect handling.
        i   u   argument must be among %su   , N(   R   R   t   coefsR   R   R   RL   R   R  R   R   Rw   R  (   R0   R  R|  R-   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    -$	c         C` s^   |  j    \ } } |  j   \ } } t t | |  d  } t t | |  d  } | | S(   u   
        Returns the aspect ratio of the raw data.

        This method is intended to be overridden by new projection
        types.
        gKH9(   t
   get_xboundt
   get_yboundR   t   abs(   R0   t   xmint   xmaxt   ymint   ymaxt   xsizet   ysize(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_data_ratio  s
    c         C` s   |  j    \ } } |  j   \ } } t t t j |  t j |   d  } t t t j |  t j |   d  } | | S(   u   
        Returns the aspect ratio of the raw data in log scale.
        Will be used when both axis scales are in log.
        gKH9(   R  R  R   R  t   matht   log10(   R0   R  R  R  R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_data_ratio_log  s
    ++c   0      C` sn  | d	 k r! |  j d t  } n  |  j   } |  j d k r |  j   |  j   } } | d k rv | d k rv d } q | d k r | d k r d } q | d k r | d k s | d k r | d k r | d k r t j d | | f  d } q q n d } | d k r"|  j	 | d d d	 S| d
 k r7d } n | } |  j
   j   \ } } | | }	 |  j d k r|  |  j k rt d   n  | d k r| |  j   }
 n | |  j   }
 | j   } | j |
 | |	  } |  j	 | j |  j   |  d  d	 S|  j	 | d d |  j   \ } } |  j   \ } } | d k rt j |  t j |  } } t j |  t j |  } } n  t t | |  d  } t t | |  d  } | j \ } } } } |	 | | }
 |
 | } | | | d } t |  d k  rd	 S| d k r}|  j } t j | j  t j | j  } t j | j  t j | j   } d | } d | } n# |  j } d | j! } d | j" } | | } | | } | | }  | | }! |! | }" |  | }# d }$ d }% |  |  j# k }& |  |  j$ k }' |& r!|' r!t d   n  |' r0t% }( nc | |$ k r{| |% k r{|# d k r`| d k  pu|" d k  ou| d k }) n | d k }) |& p|) }( |( rd | | }* |* |  d }+ |* |  d }, | d k r|  j& d |+ d |, f  qj|  j& |+ |, f  ng d | | }- |- |! d }. |- |! d }/ | d k rW|  j' d |. d |/ f  n |  j' |. |/ f  d	 S(   uP  
        Adjust the Axes for a specified data aspect ratio.

        Depending on `.get_adjustable` this will modify either the Axes box
        (position) or the view limits. In the former case, `.get_anchor`
        will affect the position.

        Notes
        -----
        This is called automatically when each Axes is drawn.  You may need
        to call it yourself if you need to update the Axes position and/or
        view limits before the Figure is drawn.

        See Also
        --------
        matplotlib.axes.Axes.set_aspect
            for a description of aspect ratio handling.
        matplotlib.axes.Axes.set_adjustable
            defining the parameter to adjust in order to meet the required
            aspect.
        matplotlib.axes.Axes.set_anchor
            defining the position in case of extra space.
        R  u   polaru   linearu   logu   autou:   aspect is not supported for Axes with xscale=%s, yscale=%sR   u   activeNu   equali   u   boxu
   box-forceduJ   Adjustable 'box' is not allowed in a twinned Axes.  Use 'datalim' instead.gKH9g      ?g{Gzt?g?i    u>   adjustable='datalim' is not allowed when both axes are shared.g      ?g       @g      $@(   u   boxu
   box-forced((   R   R  Rw   R{  RB   t
   get_xscalet
   get_yscaleR  R  R  t
   get_figuret   get_size_inchesR   R  t   RuntimeErrorR  R  R   t   shrunk_to_aspectt   anchoredR  R  R  R  R  R   R  R   R   R   R   R   R   R   R   R   R   R9  t
   set_yboundt
   set_xbound(0   R0   t   positionR  R   R   t   aspect_scale_modet   At   figWt   figHt
   fig_aspectt
   box_aspectt   pbt   pb1R  R  R  R  R  R  t   lRy  t   wt   ht
   data_ratiot
   y_expandert   dLt   dL_widtht	   dL_heightt   xrt   yrt   xmargt   ymargt   Ysizet   Xsizet   Xmargt   Ymargt   xmt   ymt   shared_xt   shared_yt   adjust_yt   adjyt   ycR   R   t   xcR   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   apply_aspect  s    			
""
	""
	





	c         O` se  t  |  d k rX t  |  d k rX |  j   \ } } |  j   \ } } | | | | f S| j d t  } t  |  d k rt | d t j  r| d j   } | d k r |  j	   n| d k r |  j
   n| d k r|  j t  |  j d
  |  j d t  | d k r,|  j d d d q| d k ra|  j d d d d d |  j t  q| d k r|  j d t  |  j t  q| d k r|  j d t  |  j t  |  j d d d d d q| d k r|  j d d d d d |  j t  |  j   }	 |  j   }
 t t j |	  t j |
   } |  j |	 d |	 d | g d | d t |  j |
 d |
 d | g d | d t qn t d |   |  j   \ } } |  j   \ } } | | | | f Sy | d Wn t k
 r| j d d  } | j d d  } t } | d k rD| d k rDd } n  |  j | | d | d | \ } } | j d d  } | j d d  } t } | d k r| d k rd } n  |  j | | d | d | \ } } | | | | f SX| d } t  |  d k rt d   n  |  j | d | d g d | d t |  j | d | d g d | d t | S(    u  Set axis properties.

        Valid signatures::

          xmin, xmax, ymin, ymax = axis()
          xmin, xmax, ymin, ymax = axis(list_arg)
          xmin, xmax, ymin, ymax = axis(string_arg)
          xmin, xmax, ymin, ymax = axis(**kwargs)

        Parameters
        ----------
        v : list of float or {'on', 'off', 'equal', 'tight', 'scaled',            'normal', 'auto', 'image', 'square'}
            Optional positional argument

            Axis data limits set from a list; or a command relating to axes:

                ========== ================================================
                Value      Description
                ========== ================================================
                'on'       Toggle axis lines and labels on
                'off'      Toggle axis lines and labels off
                'equal'    Equal scaling by changing limits
                'scaled'   Equal scaling by changing box dimensions
                'tight'    Limits set such that all data is shown
                'auto'     Automatic scaling, fill rectangle with data
                'normal'   Same as 'auto'; deprecated
                'image'    'scaled' with axis limits equal to data limits
                'square'   Square plot; similar to 'scaled', but initially                           forcing xmax-xmin = ymax-ymin
                ========== ================================================

        emit : bool, optional
            Passed to set_{x,y}lim functions, if observers
            are notified of axis limit change

        xmin, ymin, xmax, ymax : float, optional
            The axis limits to be set

        Returns
        -------
        xmin, xmax, ymin, ymax : float
            The axis limits

        i    u   emiti   u   onu   offu   equalu   tightu   scaledu   normalu   autou   imageu   squaret   tightR  u   datalimu   boxR  u   CR(  R)  u-   Unrecognized string %s to axis; try on or offu   xminu   xmaxu   yminu   ymaxi   u$   v must contain [xmin xmax ymin ymax]i   i   (   u   equalu   tightu   scaledu   normalu   autou   imageu   squareN(   R   R7  R@  R]   Rw   R{   Rq   R|   t   lowerRc  t   set_axis_offt   set_autoscale_onR  t   autoscale_viewR9  R   RV   t   diffR8  RA  R   t
   IndexErrorR   (   R0   Ry   R=   R  R  R  R  R(  t   st   xlimt   ylimt	   edge_sizeR)  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR*    s    /$(	!
	$	$
''c         C` s   |  j  S(   u>   Return the `Legend` instance, or None if no legend is defined.(   RT  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_legend  s    c         C` s   t  j d |  j  S(   u2   return a list of Axes images contained by the Axesu	   AxesImage(   R   t   silent_listRR  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_images  s    c         C` s   t  j d |  j  S(   u,   Return a list of lines contained by the Axesu   Line2D(   R   R  R	  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   get_lines  s    c         C` s   |  j  S(   u   Return the XAxis instance.(   R>   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   get_xaxis   s    c         C` s   t  j d |  j j    S(   u5   Get the x grid lines as a list of `Line2D` instances.u   Line2D xgridline(   R   R  R>   t   get_gridlines(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xgridlines$  s    	c         C` s   t  j d |  j j    S(   u5   Get the x tick lines as a list of `Line2D` instances.u   Line2D xtickline(   R   R  R>   t   get_ticklines(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xticklines)  s    	c         C` s   |  j  S(   u   Return the YAxis instance.(   R?   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   get_yaxis.  s    c         C` s   t  j d |  j j    S(   u5   Get the y grid lines as a list of `Line2D` instances.u   Line2D ygridline(   R   R  R?   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_ygridlines2  s    	c         C` s   t  j d |  j j    S(   u5   Get the y tick lines as a list of `Line2D` instances.u   Line2D ytickline(   R   R  R?   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yticklines7  s    	c         C` sw   t  | t j j  r= | j d |  j k rj t d   qj n- | |  j k rj | |  j k rj t d   n  | |  _ d S(   uZ   
        helper for :func:`~matplotlib.pyplot.sci`;
        do not use elsewhere.
        i    u"   ContourSet must be in current AxesuA   Argument must be an image, collection, or ContourSet in this AxesN(   R{   R   t   contourt
   ContourSetRU  R   RR  RS  (   R0   t   im(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _sci>  s    c         C` s   |  j  S(   uZ   
        Helper for :func:`~matplotlib.pyplot.gci`;
        do not use elsewhere.
        (   RS  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _gciM  s    c         C` s:   t  |  j  t  |  j  t  |  j  t  |  j  d k S(   u   
        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   RU  RR  R	  RN  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   has_dataT  s    &c         ` sU     | _    j j |    j |  | j   j    f d   | _ t   _ | S(   uU  Add any :class:`~matplotlib.artist.Artist` to the axes.

        Use `add_artist` only for artists for which there is no dedicated
        "add" method; and if necessary, use a method such as `update_datalim`
        to manually update the dataLim if the artist is to be included in
        autoscaling.

        Returns the artist.
        c         ` s     j  j |   S(   N(   RQ  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   p  s    (	   R-   RQ  R   R   Rd  R1  R   Rw   R  (   R0   R  (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   add_artistb  s    
		c         ` s   | j    } | s/ | j d t   j   n    j j |    j |  | j   d k rq | j   j	  n  | r   j
 | j   j   n    f d   | _ t   _ | S(   u   
        Add a :class:`~matplotlib.collections.Collection` instance
        to the axes.

        Returns the collection.
        u   _collection%dc         ` s     j  j |   S(   N(   RU  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    N(   R   R   R   RU  R   R   t   get_clip_pathR   Rd  R1  t   update_datalimt   get_datalimR   R   Rw   R  (   R0   t
   collectiont   autolimR   (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   add_collectiont  s    	c         ` se     j  |  | j   s6 | j d t   j   n    j j |    f d   | _ t   _ | S(   ue   
        Add a :class:`~matplotlib.image.AxesImage` to the axes.

        Returns the image.
        u   _image%dc         ` s     j  j |   S(   N(   RR  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    (	   R   R   R   R   RR  R   R   Rw   R  (   R0   t   image(    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   add_image  s    	c         C` s>   | j    \ } } } } |  j j | | f | | f f  d  S(   N(   t
   get_extentR-   R  (   R0   R  R  R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _update_image_limits  s    c         ` s     j  |  | j   d k r2 | j   j  n    j |  | j   sh | j d t   j	   n    j	 j
 |    f d   | _ t   _ | S(   uv   
        Add a :class:`~matplotlib.lines.Line2D` to the list of plot
        lines

        Returns the line.
        u   _line%dc         ` s     j  j |   S(   N(   R	  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    N(   R   R  R   Rd  R1  t   _update_line_limitsR   R   R   R	  R   R   Rw   R  (   R0   RM   (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   add_line  s    	c         ` s<     j  |    j j |    f d   | _ t   _ | S(   u
   

        c         ` s     j  j |   S(   N(   RO  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    (   R   RO  R   R   Rw   R  (   R0   t   txt(    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   _add_text  s
    	c         C` s  | j    } | j j d k r" d S| j   } | |  j k rF | } ny t | j |  j   r | |  j } |  j j r | j   } | j	   \ } } | j
 |  } q | j |  } n | } | j j d k r| j |  j  \ }	 }
 |  j j | |  j d |	 d |
 t |  _ n  d S(   uV   
        Figures out the data limit of the given line, updating self.dataLim.
        i    Nt   updatext   updatey(   t   get_patht   verticesR+  R  R   Rb   t   contains_branch_seperatelyt	   is_affinet   _get_transformed_patht   get_transformed_path_and_affinet   transform_path_affinet   transform_pathR   t   update_from_pathR3  R9  (   R0   RM   t   patht
   line_transt	   data_patht   trans_to_datat   line_trans_patht   na_patht   _R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s,    		c         ` se     j  |  | j   d k r2 | j   j  n    j |    j j |    f d   | _ | S(   u  
        Add a :class:`~matplotlib.patches.Patch` *p* to the list of
        axes patches; the clipbox will be set to the Axes clipping
        box.  If the transform is not set, it will be set to
        :attr:`transData`.

        Returns the patch.
        c         ` s     j  j |   S(   N(   RN  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    N(	   R   R  R   Rd  R1  t   _update_patch_limitsRN  R   R   (   R0   Rf   (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   add_patch  s    
c         C` s   t  | t j  r0 | j   r0 | j   r0 d S| j   j } | j d k r | j   j	 |  } | j
   |  j k r | j
   |  j } | j	 |  } n  | j   j |  j  \ } } |  j | d | d | n  d S(   u$   update the data limits for patch *p*Ni    R  R  (   R{   Rt   R!  t	   get_widtht
   get_heightR  R  R+  t   get_patch_transformt	   transformt   get_data_transformR   R  R  R  (   R0   R1  R  t   xyst   patch_to_dataR  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    
	
c         ` sC     j  |    j j |  | j   j    f d   | _ | S(   u  
        Add a :class:`~matplotlib.table.Table` instance to the
        list of axes tables

        Parameters
        ----------
        tab: `matplotlib.table.Table`
            Table instance

        Returns
        -------
        `matplotlib.table.Table`: the table.
        c         ` s     j  j |   S(   N(   RP  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   #  s    (   R   RP  R   Rd  R1  R   (   R0   t   tab(    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   add_table  s
    c         ` sY   | j    } | s/ | j d t   j   n    j j |  | j   f d    | S(   u   
        Add a :class:`~matplotlib.container.Container` instance
        to the axes.

        Returns the collection.
        u   _container%dc         ` s     j  j |   S(   N(   RV  R   (   R  (   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   1  s    (   R   R   R   RV  R   t   set_remove_method(   R0   R   R   (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   add_container&  s    c         C` s$   |  j    |  j d | d |  d S(   u   
        Callback for processing changes to axis units.

        Currently forces updates of data limits and view limits.
        R   R   N(   t   relimR  (   R0   R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   4  s    
c         C` s   |  j  j t  |  j  j t j j   j    t |  _ x4 |  j	 D]) } | s[ | j
   rB |  j |  qB qB Wx4 |  j D]) } | s | j
   ry |  j |  qy qy Wx4 |  j D]) } | s | j
   r |  j |  q q Wd S(   u  
        Recompute the data limits based on current artists. If you want to
        exclude invisible artists from the calculation, set
        ``visible_only=True``

        At present, :class:`~matplotlib.collections.Collection`
        instances are not supported.
        N(   R   Rc   Rw   t
   set_pointsR   R   R   t
   get_pointsR3  R	  R2  R  RN  R   RR  R  (   R0   t   visible_onlyRM   Rf   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  =  s    	c         C` sN   t  j |  } t |  s d S|  j j | |  j d | d | t |  _ d S(   uR   
        Update the data lim bbox with seq of xy tups or equiv. 2-D array
        NR  R  (   RV   t   asarrayR   R   t   update_from_data_xyR3  R9  (   R0   R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  X  s    c         C` s)   |  j  j t j j |  j  | g   d S(   uo   
        Update the datalim to include the given
        :class:`~matplotlib.transforms.Bbox` *bounds*
        N(   R   RL   R   R   t   union(   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   update_datalim_boundsg  s    c         C` s  |  j  d k s |  j d k r" d S| d k	 rS |  j  j   sS |  j  j |  qS n  | d k	 r |  j j   s |  j j |  q n  | d k	 r| j d |  j  j  } |  j d k r | j d |  } n  | |  j  j k r|  j  j |  | d k	 r|  j  j |  qn  | j d |  j j  } |  j d k rL| j d |  } n  | |  j j k r|  j j |  | d k	 r|  j j |  qqn  | S(   uA   Look for unit *kwargs* and update the axis instances as necessaryNu   xunitsu   polaru
   thetaunitsu   yunitsu   runits(	   R>   R   R?   t
   have_unitsRQ   R@   RA   RB   RC   (   R0   t   xdatat   ydataR=   RE   RF   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _process_unit_infon  s0    c         C` s   |  j  j |  d S(   ud   
        Return *True* if the given *mouseevent* (in display coords)
        is in the Axes
        i    (   R1  t   contains(   R0   t
   mouseevent(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   in_axes  s    c         C` s   |  j  o |  j S(   uS   
        Get whether autoscaling is applied for both axes on plot commands
        (   RE  RF  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_autoscale_on  s    c         C` s   |  j  S(   uT   
        Get whether autoscaling for the x-axis is applied on plot commands
        (   RE  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_autoscalex_on  s    c         C` s   |  j  S(   uT   
        Get whether autoscaling for the y-axis is applied on plot commands
        (   RF  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_autoscaley_on  s    c         C` s   | |  _  | |  _ d S(   u   
        Set whether autoscaling is applied on plot commands

        .. ACCEPTS: bool

        Parameters
        ----------
        b : bool
        N(   RE  RF  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    
	c         C` s   | |  _  d S(   u   
        Set whether autoscaling for the x-axis is applied on plot commands

        .. ACCEPTS: bool

        Parameters
        ----------
        b : bool
        N(   RE  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_autoscalex_on  s    
c         C` s   | |  _  d S(   u   
        Set whether autoscaling for the y-axis is applied on plot commands

        .. ACCEPTS: bool

        Parameters
        ----------
        b : bool
        N(   RF  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_autoscaley_on  s    
c         C` s   |  j  S(   u  
        When autoscaling, whether to obey all `Artist.sticky_edges`.

        Default is ``True``.

        Setting this to ``False`` ensures that the specified margins
        will be applied, even if the plot includes an image, for
        example, which would otherwise force a view limit to coincide
        with its data limit.

        The changing this property does not change the plot until
        `autoscale` or `autoscale_view` is called.
        (   RJ  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   use_sticky_edges  s    c         C` s   t  |  |  _ d  S(   N(   t   boolRJ  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR!    s    c         C` s1   | d k r t  d   n  | |  _ t |  _ d S(   uo  
        Set padding of X data limits prior to autoscaling.

        *m* times the data interval will be added to each
        end of that interval before it is used in autoscaling.
        For example, if your data is in the range [0, 2], a factor of
        ``m = 0.1`` will result in a range [-0.2, 2.2].

        Negative values -0.5 < m < 0 will result in clipping of the data range.
        I.e. for a data range [0, 2], a factor of ``m = -0.1`` will result in
        a range [0.2, 1.8].

        .. ACCEPTS: float greater than -0.5

        Parameters
        ----------
        m : float greater than -0.5
        g      u    margin must be greater than -0.5N(   R   RG  Rw   R  (   R0   t   m(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_xmargin  s    	c         C` s1   | d k r t  d   n  | |  _ t |  _ d S(   uo  
        Set padding of Y data limits prior to autoscaling.

        *m* times the data interval will be added to each
        end of that interval before it is used in autoscaling.
        For example, if your data is in the range [0, 2], a factor of
        ``m = 0.1`` will result in a range [-0.2, 2.2].

        Negative values -0.5 < m < 0 will result in clipping of the data range.
        I.e. for a data range [0, 2], a factor of ``m = -0.1`` will result in
        a range [0.2, 1.8].

        .. ACCEPTS: float greater than -0.5

        Parameters
        ----------
        m : float greater than -0.5
        g      u    margin must be greater than -0.5N(   R   RH  Rw   R  (   R0   R#  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_ymargin	  s    	c         O` s)  | r | r |  j  |  j f S| j d t  } | j d d  } | j d d  } t |  d k rw | d } } nB t |  d k r | \ } } n! t |  d k r t d   n  | d k	 r |  j |  n  | d k	 r |  j |  n  | d k	 } | d k	 } |  j	 d | d	 | d
 |  d S(   u  
        Set or retrieve autoscaling margins.

        signatures::

            margins()

        returns xmargin, ymargin

        ::

            margins(margin)

            margins(xmargin, ymargin)

            margins(x=xmargin, y=ymargin)

            margins(..., tight=False)

        All three forms above set the xmargin and ymargin parameters.
        All keyword parameters are optional.  A single argument
        specifies both xmargin and ymargin. The padding added to the end of
        each interval is *margin* times the data interval. The *margin* must
        be a float in the range [0, 1].

        The *tight* parameter is passed to :meth:`autoscale_view`
        , which is executed after a margin is changed; the default here is
        *True*, on the assumption that when margins are specified, no
        additional padding to match tick marks is usually desired.  Setting
        *tight* to *None* will preserve the previous setting.

        Specifying any margin changes only the autoscaling; for example,
        if *xmargin* is not None, then *xmargin* times the X data
        interval will be added to each end of that interval before
        it is used in autoscaling.

        u   tightu   xu   yi   i    i   u%   more than two arguments were suppliedR  R   R   N(
   RG  RH  R@   Rw   R   R   R   R$  R%  R  (   R0   R<   R_   R  t   mxt   myR   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   margins	  s$    &c         C` s   | |  _  t |  _ d S(   u   
        Parameters
        ----------
        z : float or None
            zorder below which artists are rasterized.  ``None`` means that
            artists do not get rasterized based on zorder.

            .. ACCEPTS: float or None
        N(   R   Rw   R  (   R0   t   z(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_rasterization_zorderU	  s    
	c         C` s   |  j  S(   u?   Return the zorder value below which artists will be rasterized.(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_rasterization_zorderb	  s    c         C` s   | d k r t } t } nZ t } t } | d	 k rN t |  |  _ |  j } n  | d
 k ru t |  |  _ |  j } n  | r | r d |  _ n  | r | r d |  _ n  |  j d | d | d |  d S(   u  
        Autoscale the axis view to the data (toggle).

        Convenience method for simple axis view autoscaling.
        It turns autoscaling on or off, and then,
        if autoscaling for either axis is on, it performs
        the autoscaling on the specified axis or axes.

        Parameters
        ----------
        enable : bool or None, optional
            True (default) turns autoscaling on, False turns it off.
            None leaves the autoscaling state unchanged.

        axis : ['both' | 'x' | 'y'], optional
            which axis to operate on; default is 'both'

        tight: bool or None, optional
            If True, set view limits to data limits;
            if False, let the locator and margins expand the view limits;
            if None, use tight scaling if the only artist is an image,
            otherwise treat *tight* as False.
            The *tight* setting is retained for future autoscaling
            until it is explicitly changed.

        u   xu   bothu   yi    R  R   R   N(   u   xu   both(   u   yu   both(	   R   Rw   R9  R"  RE  RF  RG  RH  R  (   R0   t   enableR*  R  R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   autoscalef	  s     	c      
   ` s  | d k	 r t |    _ n    j r(  j s9   j r(g    j   D] } | j ^ qF } t g  | D] } | j	 ^ qe g   } t g  | D] } | j
 ^ q g   }   j   j   d k r g  | D] }	 |	 d k r |	 ^ q } n    j   j   d k r5g  | D] }
 |
 d k r|
 ^ q} q5n g  g  } }   f d   } | |   j   j d d   j   j |   j 	 | |   j   j d d   j   j |   j 	 d S(	   u  
        Autoscale the view limits using the data limits.

        You can selectively autoscale only a single axis, e.g., the xaxis by
        setting *scaley* to *False*.  The autoscaling preserves any
        axis direction reversal that has already been done.

        If *tight* is *False*, the axis major locator will be used
        to expand the view limits if rcParams['axes.autolimit_mode']
        is 'round_numbers'.  Note that any margins that are in effect
        will be applied first, regardless of whether *tight* is
        *True* or *False*.  Specifying *tight* as *True* or *False*
        saves the setting as a private attribute of the Axes; specifying
        it as *None* (the default) applies the previously saved value.

        The data limits are not updated automatically when artist data are
        changed after the artist has been added to an Axes instance.  In that
        case, use :meth:`matplotlib.axes.Axes.relim` prior to calling
        autoscale_view.
        u   logi    c	         ` s  |  o	 | s d  S| j     }	 g  |	 D] }
 |
 j ^ q& } g  | D]! } t j |  j   rB | ^ qB } t |  rg  | D]0 } t j | j  j   r| | | k r| | ^ q| } g  | D]0 } t j | j  j   r | | k r | ^ q } | } | j |  | j |  n  t	 j
 j |  } t | |  \ } } | j   } y | j | |  \ } } Wn5 t k
 rt	 j | | d t d d \ } } n Xt | |  } | j   } | j   } t j t j | |   } t j t j | |   } | j j | | |  \ } } | j | | g  \ } } | | | } | rR| | 8} n  | re| | 7} n  | j | | g  \ } }   j s| j | |  \ } } n  | | |  d  S(   Nt
   increasingt   expanderg?(   R  R   RV   t   isfiniteRa   R   t	   intervalxt	   intervalyt   extendR   R  R  R   t   get_major_locatort   nonsingularR  R9  R  t   invertedRb   t   iscloseR=  t   limit_range_for_scaleR  RI  t   view_limits(   R   t   autoscaleont   shared_axest   intervalt   minposR*  t   margint   stickiest	   set_boundt   sharedR  t   dlt   dt	   finite_dlt   x_finitet   y_finitet   bbR   R   R  R  t   inverse_transt   do_lower_margint   do_upper_margint   x0tt   x1tt   delta(   R0   (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   handle_single_axis	  sN    ."	u	   intervalxu   minposxu	   intervalyu   minposyN(   R   R"  RI  R!  RG  RH  t   get_childrent   sticky_edgest   sumRX   RY   R  R  R  RE  R   R>   R  RF  R   R?   R  (   R0   R  R   R   R   R?  t   stickyt
   x_stickiest
   y_stickiest   xst   ysRN  (    (   R0   s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  	  s$    "%%(+:c         C` s   |  j  |  j f S(   N(   R>   R?   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _get_axis_list	  s    c         C` sb  | d k r |  j } n  | d k r3 t d   n  |  j   sC d S| j d  t |  _ |  j   } | r | |  |  } |  j |  n
 |  j   |  j	   } | j
 |  j  |  j o |  j s x* t j |  j  D] } | j
 |  q Wn  |  j r| r|  j t k r1|  j j d  |  j j d  q|  j t k rc|  j j d  |  j j d  q|  j j d  |  j j d  n$ x! |  j   D] } | j
 |  qW| r| j
 |  j  | j
 |  j  | j
 |  j  n  |  j j j   s-g  | D]( } | j   s| |  j k r| ^ q} n  t | d t  d  } |  j! }	 |	 d k	 r| r| d	 j" |	 k  r| j#   g  | D] } | j" |	 k  r| ^ q}
 g  | D] } | j" |	 k r| ^ q} n g  }
 |  j r|  j r|  j j$ |  n  |
 r,x |
 D] } | j$ |  qW| j%   n  t& j' | |  |  | j( d  | |  _ t |  _) d S(
   u*   Draw everything (plot lines, axes, labels)u   No renderer definedNu   axesg      ?g      @g      ?t   keyu   zorderi    (*   R   R   R  R2  t
   open_groupRw   R   R  R  RO  R   R1  t   axisonR   Rq   t
   itervaluesR   R   R>   t
   set_zorderR?   R9  RW  R\  R]  R^  R   t   canvast	   is_savingt   get_animatedRR  t   sortedR   R   t   zordert   start_rasterizingt   drawt   stop_rasterizingt   mimaget   _draw_list_compositing_imagest   close_groupR  (   R0   t   renderert   inframeR  R  RQ  Rj  t   _axisR  t   rasterization_zordert   artists_rasterized(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRc  	  sp    	
+	
	c         C` s2   |  j  d k r t d   n  | j |  j   d S(   u   
        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)
        uL   draw_artist can only be used after an initial draw which caches the rendererN(   R   R   R  Rc  (   R0   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   draw_artistQ
  s    c         C` s8   |  j  d k r t d   n  |  j |  j  d t d S(   u   
        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)
        uP   redraw_in_frame can only be used after an initial draw which caches the rendererRi  N(   R   R   R  Rc  Rw   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   redraw_in_frame\
  s    c         C` s   |  j  S(   N(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_renderer_cacheg
  s    c         C` s   |  j  S(   u@   
        Get whether the axes rectangle patch is drawn.
        (   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_frame_onl
  s    c         C` s   | |  _  t |  _ d S(   u   
        Set whether the axes rectangle patch is drawn.

        .. ACCEPTS: bool

        Parameters
        ----------
        b : bool
        N(   R   Rw   R  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_frame_onr
  s    
	c         C` s   |  j  S(   uW   
        Get whether axis ticks and gridlines are above or below most artists.
        (   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_axisbelow
  s    c         C` s   t  |  |  _ t |  _ d S(   u   
        Set whether axis ticks and gridlines are above or below most artists.

        .. ACCEPTS: [ bool | 'line' ]

        Parameters
        ----------
        b : bool or 'line'
        N(   R   R   Rw   R  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_axisbelow
  s    
u   majorc         K` s   t  |  r t } n | d k	 r0 t |  } n  | d k sH | d k rd |  j j | d | | n  | d k s| | d k r |  j j | d | | n  d S(   u  
        Turn the axes grids on or off.

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

        *which* can be 'major' (default), 'minor', or 'both' to control
        whether major tick grids, minor tick grids, or both are affected.

        *axis* can be 'both' (default), 'x', or 'y' to control which
        set of gridlines are drawn.

        *kwargs* are used to set the grid line properties, e.g.,::

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

        Valid :class:`~matplotlib.lines.Line2D` kwargs are

        %(Line2D)s

        u   xu   bothR   u   yN(   R   Rw   R   R	   R>   RW  R?   (   R0   Ry  R   R*  R=   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRW  
  s    	c         K` s  | j  d d  j   } | j  d d  } | j  d d  } | j  d d  } | j  d d  } | j  d d  j   } | d k	 r y | \ } }	 | |	 d	 Wq t t f k
 r t d
   q Xn  | d  d k r t }
 nQ | d k r t }
 n< | d k rt d   n! | d k r'd }
 n t d   y9|
 d k	 r| d k sZ| d k rs|  j j	 j
 j |
  n  | d k s| d k r|  j j	 j
 j |
  qn  | d k	 r| d k s| d k r|  j j	 j
 j |  n  | d k s| d k r|  j j	 j
 j |  qn  | d k	 r| d k s<| d k rU|  j j	 j
 j |  n  | d k sm| d k r|  j j	 j
 j |  qn  | d k	 r| d k s| d k r|  j j	 j
 j |  n  | d k s| d k r|  j j	 j
 j |  qn  | d k	 rk| d k s| d k r7|  j j	 j
 j |  n  | d k sO| d k rk|  j j	 j
 j |  qkn  Wn t k
 rt d   n Xd S(   u  
        Change the `~matplotlib.ticker.ScalarFormatter` used by
        default for linear axes.

        Optional keyword arguments:

          ==============   =========================================
          Keyword          Description
          ==============   =========================================
          *style*          [ 'sci' (or 'scientific') | 'plain' ]
                           plain turns off scientific notation
          *scilimits*      (m, n), pair of integers; if *style*
                           is 'sci', scientific notation will
                           be used for numbers outside the range
                           10`m`:sup: to 10`n`:sup:.
                           Use (0,0) to include all numbers.
          *useOffset*      [ bool | offset ]; if True,
                           the offset will be calculated as needed;
                           if False, no offset will be used; if a
                           numeric offset is specified, it will be
                           used.
          *axis*           [ 'x' | 'y' | 'both' ]
          *useLocale*      If True, format the number according to
                           the current locale.  This affects things
                           such as the character used for the
                           decimal separator.  If False, use
                           C-style (English) formatting.  The
                           default setting is controlled by the
                           axes.formatter.use_locale rcparam.
          *useMathText*    If True, render the offset and scientific
                           notation in mathtext
          ==============   =========================================

        Only the major ticks are affected.
        If the method is called when the
        :class:`~matplotlib.ticker.ScalarFormatter` is not the
        :class:`~matplotlib.ticker.Formatter` being used, an
        :exc:`AttributeError` will be raised.

        u   styleu    u	   scilimitsu	   useOffsetu	   useLocaleu   useMathTextu   axisu   bothi   u*   scilimits must be a sequence of 2 integersi   u   sciu   plainu   commau   comma style remains to be addedu   %s is not a valid style valueu   xu   yu0   This method only works with the ScalarFormatter.N(   R@   R  R   R   R?  Rw   R9  t   NotImplementedErrorR>   R5  t	   formattert   set_scientificR?   t   set_powerlimitst   set_useOffsett   set_useLocalet   set_useMathTextR  (   R0   R=   t   stylet	   scilimitst	   useOffsett	   useLocalet   useMathTextR*  R#  t   nt   sb(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   ticklabel_format
  sd    )			 c         K` sv   | d k } | d	 k } | r7 |  j  j   j |   n  | rV |  j j   j |   n  |  j d | d | d |  d S(
   u  
        Control behavior of tick locators.

        Parameters
        ----------
        axis : ['both' | 'x' | 'y'], optional
            The axis on which to operate.

        tight : bool or None, optional
            Parameter passed to :meth:`autoscale_view`.
            Default is None, for no change.

        Other Parameters
        ----------------
        **kw :
            Remaining keyword arguments are passed to directly to the
            :meth:`~matplotlib.ticker.MaxNLocator.set_params` method.

        Typically one might want to reduce the maximum number
        of ticks and use tight bounds when plotting small
        subplots, for example::

            ax.locator_params(tight=True, nbins=4)

        Because the locator is involved in autoscaling,
        :meth:`autoscale_view` is called automatically after
        the parameters are changed.

        This presently works only for the
        :class:`~matplotlib.ticker.MaxNLocator` used
        by default on linear axes, but it may be generalized.
        u   xu   bothu   yR  R   R   N(   u   xu   both(   u   yu   both(   R>   R4  t
   set_paramsR?   R  (   R0   R*  R  R=   t   _xt   _y(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   locator_params  s    !c         K` s   | d k rk t  |  } | j d d  | j d d  | j d d  | j d d  |  j j |   n  | d k r t  |  } | j d d  | j d	 d  | j d
 d  | j d d  |  j j |   n  d S(   ua	  Change the appearance of ticks, tick labels, and gridlines.

        Parameters
        ----------
        axis : {'x', 'y', 'both'}, optional
            Which axis to apply the parameters to.

        Other Parameters
        ----------------

        axis : {'x', 'y', 'both'}
            Axis on which to operate; default is 'both'.

        reset : bool
            If *True*, set all parameters to defaults
            before processing other keyword arguments.  Default is
            *False*.

        which : {'major', 'minor', 'both'}
            Default is 'major'; apply arguments to *which* ticks.

        direction : {'in', 'out', 'inout'}
            Puts ticks inside the axes, outside the axes, or both.

        length : float
            Tick length in points.

        width : float
            Tick width in points.

        color : color
            Tick color; accepts any mpl color spec.

        pad : float
            Distance in points between tick and label.

        labelsize : float or str
            Tick label font size in points or as a string (e.g., 'large').

        labelcolor : color
            Tick label color; mpl color spec.

        colors : color
            Changes the tick color and the label color to the same value:
            mpl color spec.

        zorder : float
            Tick and label zorder.

        bottom, top, left, right : bool
            Whether to draw the respective ticks.

        labelbottom, labeltop, labelleft, labelright : bool
            Whether to draw the respective tick labels.

        labelrotation : float
            Tick label rotation

        grid_color : color
            Changes the gridline color to the given mpl color spec.

        grid_alpha : float
            Transparency of gridlines: 0 (transparent) to 1 (opaque).

        grid_linewidth : float
            Width of gridlines in points.

        grid_linestyle : string
            Any valid :class:`~matplotlib.lines.Line2D` line style spec.

        Examples
        --------

        Usage ::

            ax.tick_params(direction='out', length=6, width=2, colors='r',
                           grid_color='r', grid_alpha=0.5)

        This will make all major ticks be red, pointing out of the box,
        and with dimensions 6 points by 2 points.  Tick labels will
        also be red.  Gridlines will be red and translucent.

        u   xu   bothu   leftu   rightu	   labelleftu
   labelrightu   yu   topu   bottomu   labeltopu   labelbottomN(   u   xu   both(   u   yu   both(   t   dictR@   R   R>   t   set_tick_paramsR?   (   R0   R*  R=   t   xkwt   ykw(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   <  s    Tc         C` s   t  |  _ t |  _ d S(   u   Turn off the axis.N(   R9  RZ  Rw   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    	c         C` s   t  |  _ t  |  _ d S(   u   Turn on the axis.N(   Rw   RZ  R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRc    s    	c         C` s*   |  j  |  j   d d d  d d d S(   u   Invert the x-axis.NiR)  (   R8  R7  R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   invert_xaxis  s    c         C` s   |  j    \ } } | | k  S(   u&   Return whether the x-axis is inverted.(   R7  (   R0   R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   xaxis_inverted  s    c         C` s6   |  j    \ } } | | k  r( | | f S| | f Sd S(   u>   Return the lower and upper x-axis bounds, in increasing order.N(   R7  (   R0   R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    
c         C` s   | d k r' t |  r' | \ } } n  |  j   \ } } | d k rN | } n  | d k rc | } n  |  j   r | | k  r |  j | | d d q |  j | | d d n; | | k  r |  j | | d d n |  j | | d d d S(   u  
        Set the lower and upper numerical bounds of the x-axis.

        This method will honor axes inversion regardless of parameter order.
        It will not change the _autoscaleXon attribute.

        .. ACCEPTS: (lower: float, upper: float)
        R)  N(   R   R
   R  R  R8  (   R0   R  t   uppert	   old_lowert	   old_upper(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    			c         C` s   t  |  j j  S(   uJ  
        Get the x-axis range

        Returns
        -------
        xlimits : tuple
            Returns the current x-axis limits as the tuple
            (`left`, `right`).

        Notes
        -----
        The x-axis may be inverted, in which case the `left` value will
        be greater than the `right` value.

        (   t   tupleR   R1  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR7    s    c         C` s^   | d k	 rZ | |  } t | t  rV t j |  sG t j |  rV t d   n  | Sd S(   u   
        Raise ValueError if converted limits are non-finite.

        Note that this function also accepts None as a limit argument.

        Returns
        -------
        The limit value after call to convert(), or None if limit is None.

        u    Axis limits cannot be NaN or InfN(   R   R{   R}  RV   t   isrealR0  R   (   R0   t   limitt   convertt   converted_limit(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _validate_converted_limits  s    c   	      K` sx  d | k r | j  d  } n  d | k r< | j  d  } n  | r[ t d t |    n  | d k r t |  r | \ } } n  |  j d | | f  |  j | |  j  } |  j | |  j  } |  j   \ } } | d k r | } n  | d k r | } n  | | k r$t	 j
 d | | f  n  t j | | d t \ } } |  j   d k r|| d k sl| d k r|t	 j
 d	  n  |  j j | |  \ } } | | f |  j _ | d k	 rt |  |  _ n  | re|  j j d
 |   x |  j j |   D]k } | |  k	 r| j |  j j d t d | | j |  j k r^| j j d k	 r^| j j j   q^qqWn  t |  _ | | f S(   u  
        Set the data limits for the x-axis

        .. ACCEPTS: (left: float, right: float)

        Parameters
        ----------
        left : scalar, optional
            The left xlim (default: None, which leaves the left limit
            unchanged).

        right : scalar, optional
            The right xlim (default: None, which leaves the right limit
            unchanged).

        emit : bool, optional
            Whether to notify observers of limit change (default: True).

        auto : bool or None, optional
            Whether to turn on autoscaling of the x-axis. True turns on,
            False turns off (default action), None leaves unchanged.

        xlimits : tuple, optional
            The left and right xlims may be passed as the tuple
            (`left`, `right`) as the first positional argument (or as
            the `left` keyword argument).

        Returns
        -------
        xlimits : tuple
            Returns the new x-axis limits as (`left`, `right`).

        Notes
        -----
        The `left` value may be greater than the `right` value, in which
        case the x-axis values will decrease from left to right.

        Examples
        --------
        >>> set_xlim(left, right)
        >>> set_xlim((left, right))
        >>> left, right = set_xlim(left, right)

        One limit may be left unchanged.

        >>> set_xlim(right=right_lim)

        Limits may be passed in reverse order to flip the direction of
        the x-axis. For example, suppose `x` represents the number of
        years before present. The x-axis limits might be set like the
        following so 5000 years ago is on the left of the plot and the
        present is on the right.

        >>> set_xlim(5000, 0)

        u   xminu   xmaxu   unrecognized kwargs: %sR  uw   Attempting to set identical left==right results
in singular transformations; automatically expanding.
left=%s, right=%sR.  u   logg        uY   Attempted to set non-positive xlimits for log-scale axis; invalid limits will be ignored.u   xlim_changedR(  R)  N(   R@   R   t   listR   R
   R  R  RR   R7  R  R  R   R5  R9  R  R>   R8  R   R1  R"  RE  R   t   processR   R  R8  R   R]  t	   draw_idleRw   R  (	   R0   R   R   R(  R)  R_   t   old_leftt	   old_rightt   other(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR8    sN    9		*
	c         C` s   |  j  j   S(   N(   R>   R<  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  j  s    u!   Return the xaxis scale string: %su   , c         K` s`   |  j    } x= | j |   D], } | j j | |  | j   t | _ q W|  j d t  d S(   u  
        Set the x-axis scale.

        .. ACCEPTS: [ 'linear' | 'log' | 'symlog' | 'logit' | ... ]

        Parameters
        ----------
        value : {"linear", "log", "symlog", "logit"}
            scaling strategy to apply

        Notes
        -----
        Different kwargs are accepted, depending on the scale. See
        the `~matplotlib.scale` module for more information.

        See also
        --------
        matplotlib.scale.LinearScale : linear transform

        matplotlib.scale.LogTransform : log transform

        matplotlib.scale.SymmetricalLogTransform : symlog transform

        matplotlib.scale.LogisticTransform : logit transform
        R   N(	   t   get_shared_x_axesR  R>   R>  R   Rw   R  R  R9  (   R0   t   valueR=   t   gR  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR   o  s    
c         C` s   |  j  j d |  S(   u)   Return the x ticks as a list of locationsR6  (   R>   t   get_ticklocs(   R0   R6  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_xticks  s    c         C` s%   |  j  j | d | } t |  _ | S(   uU  
        Set the x ticks with list of *ticks*

        .. ACCEPTS: list of tick locations.

        Parameters
        ----------
        ticks : list
            List of x-axis tick locations.

        minor : bool, optional
            If ``False`` sets major ticks, if ``True`` sets minor ticks.
            Default is ``False``.
        R6  (   R>   t	   set_ticksRw   R  (   R0   t   ticksR6  RG   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   set_xticks  s    	c         C` s   t  j d |  j j    S(   u   
        Get the major x tick labels.

        Returns
        -------
        labels : list
            List of :class:`~matplotlib.text.Text` instances
        u   Text xticklabel(   R   R  R>   t   get_majorticklabels(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xmajorticklabels  s    		c         C` s   t  j d |  j j    S(   u   
        Get the minor x tick labels.

        Returns
        -------
        labels : list
            List of :class:`~matplotlib.text.Text` instances
        u   Text xticklabel(   R   R  R>   t   get_minorticklabels(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xminorticklabels  s    		c         C` s%   t  j d |  j j d | d |   S(   u  
        Get the x tick labels as a list of :class:`~matplotlib.text.Text`
        instances.

        Parameters
        ----------
        minor : bool, optional
           If True return the minor ticklabels,
           else return the major ticklabels.

        which : None, ('minor', 'major', 'both')
           Overrides `minor`.

           Selects which ticklabels to return

        Returns
        -------
        ret : list
           List of :class:`~matplotlib.text.Text` instances.
        u   Text xticklabelR6  R   (   R   R  R>   t   get_ticklabels(   R0   R6  R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_xticklabels  s    	c         K` sD   | d k	 r | j |  n  |  j j | d | | } t |  _ | S(   uR  
        Set the x-tick labels with list of string labels.

        .. ACCEPTS: list of string labels

        Parameters
        ----------
        labels : list of str
            List of string labels.

        fontdict : dict, optional
            A dictionary controlling the appearance of the ticklabels.
            The default `fontdict` is::

               {'fontsize': rcParams['axes.titlesize'],
                'fontweight': rcParams['axes.titleweight'],
                'verticalalignment': 'baseline',
                'horizontalalignment': loc}

        minor : bool, optional
            Whether to set the minor ticklabels rather than the major ones.

        Returns
        -------
        A list of `~.text.Text` instances.

        Other Parameters
        -----------------
        **kwargs : `~.text.Text` properties.
        R6  N(   R   Rj   R>   t   set_ticklabelsRw   R  (   R0   t   labelst   fontdictR6  R=   RG   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_xticklabels  s    	c         C` s*   |  j  |  j   d d d  d d d S(   u   Invert the y-axis.NiR)  (   RA  R@  R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   invert_yaxis  s    c         C` s   |  j    \ } } | | k  S(   u&   Return whether the y-axis is inverted.(   R@  (   R0   R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   yaxis_inverted  s    c         C` s6   |  j    \ } } | | k  r( | | f S| | f Sd S(   u>   Return the lower and upper y-axis bounds, in increasing order.N(   R@  (   R0   R   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    
c         C` s   | d k r' t |  r' | \ } } n  |  j   \ } } | d k rN | } n  | d k rc | } n  |  j   r | | k  r |  j | | d d q |  j | | d d n; | | k  r |  j | | d d n |  j | | d d d S(   u   
        Set the lower and upper numerical bounds of the y-axis.
        This method will honor axes inversion regardless of parameter order.
        It will not change the _autoscaleYon attribute.

        .. ACCEPTS: (lower: float, upper: float)
        R)  N(   R   R
   R  R  RA  (   R0   R  R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    		c         C` s   t  |  j j  S(   uJ  
        Get the y-axis range

        Returns
        -------
        ylimits : tuple
            Returns the current y-axis limits as the tuple
            (`bottom`, `top`).

        Notes
        -----
        The y-axis may be inverted, in which case the `bottom` value
        will be greater than the `top` value.

        (   R  R   R2  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR@  -  s    c   	      K` sb  d | k r | j  d  } n  d | k r< | j  d  } n  | r[ t d t |    n  | d k r t |  r | \ } } n  |  j | |  j  } |  j | |  j  } |  j   \ } } | d k r | } n  | d k r | } n  | | k rt j	 d | | f  n  t
 j | | d t \ } } |  j   d k rf| d k sV| d k rft j	 d  n  |  j j | |  \ } } | | f |  j _ | d k	 rt |  |  _ n  | rO|  j j d	 |   x |  j j |   D]k } | |  k	 r| j |  j j d
 t d | | j |  j k rH| j j d k	 rH| j j j   qHqqWn  t |  _ | | f S(   u  
        Set the data limits for the y-axis

        .. ACCEPTS: (bottom: float, top: float)

        Parameters
        ----------
        bottom : scalar, optional
            The bottom ylim (default: None, which leaves the bottom
            limit unchanged).

        top : scalar, optional
            The top ylim (default: None, which leaves the top limit
            unchanged).

        emit : bool, optional
            Whether to notify observers of limit change (default: True).

        auto : bool or None, optional
            Whether to turn on autoscaling of the y-axis. True turns on,
            False turns off (default action), None leaves unchanged.

        ylimits : tuple, optional
            The bottom and top yxlims may be passed as the tuple
            (`bottom`, `top`) as the first positional argument (or as
            the `bottom` keyword argument).

        Returns
        -------
        ylimits : tuple
            Returns the new y-axis limits as (`bottom`, `top`).

        Notes
        -----
        The `bottom` value may be greater than the `top` value, in which
        case the y-axis values will decrease from bottom to top.

        Examples
        --------
        >>> set_ylim(bottom, top)
        >>> set_ylim((bottom, top))
        >>> bottom, top = set_ylim(bottom, top)

        One limit may be left unchanged.

        >>> set_ylim(top=top_lim)

        Limits may be passed in reverse order to flip the direction of
        the y-axis. For example, suppose `y` represents depth of the
        ocean in m. The y-axis limits might be set like the following
        so 5000 m depth is at the bottom of the plot and the surface,
        0 m, is at the top.

        >>> set_ylim(5000, 0)
        u   yminu   ymaxu   unrecognized kwargs: %suw   Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=%s, top=%sR.  u   logg        uY   Attempted to set non-positive ylimits for log-scale axis; invalid limits will be ignored.u   ylim_changedR(  R)  N(   R@   R   R  R   R
   R  RS   R@  R  R  R   R5  R9  R  R?   R8  R   R2  R"  RF  R   R  R   R  RA  R   R]  R  Rw   R  (	   R0   R   R   R(  R)  R_   t
   old_bottomt   old_topR  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRA  ?  sL    8		*
	c         C` s   |  j  j   S(   N(   R?   R<  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    u!   Return the yaxis scale string: %sc         K` s`   |  j    } x= | j |   D], } | j j | |  | j   t | _ q W|  j d t  d S(   u  
        Set the y-axis scale.

        .. ACCEPTS: [ 'linear' | 'log' | 'symlog' | 'logit' | ... ]

        Parameters
        ----------
        value : {"linear", "log", "symlog", "logit"}
            scaling strategy to apply

        Notes
        -----
        Different kwargs are accepted, depending on the scale. See
        the `~matplotlib.scale` module for more information.

        See also
        --------
        matplotlib.scale.LinearScale : linear transform

        matplotlib.scale.LogTransform : log transform

        matplotlib.scale.SymmetricalLogTransform : symlog transform

        matplotlib.scale.LogisticTransform : logit transform
        R   N(	   t   get_shared_y_axesR  R?   R>  R   Rw   R  R  R9  (   R0   R  R=   R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    
c         C` s   |  j  j d |  S(   u)   Return the y ticks as a list of locationsR6  (   R?   R  (   R0   R6  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   get_yticks  s    c         C` s   |  j  j | d | } | S(   uX  
        Set the y ticks with list of *ticks*

        .. ACCEPTS: list of tick locations.

        Parameters
        ----------
        ticks : sequence
            List of y-axis tick locations

        minor : bool, optional
            If ``False`` sets major ticks, if ``True`` sets minor ticks.
            Default is ``False``.
        R6  (   R?   R  (   R0   R  R6  RG   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   set_yticks  s    c         C` s   t  j d |  j j    S(   u   
        Get the major y tick labels.

        Returns
        -------
        labels : list
            List of :class:`~matplotlib.text.Text` instances
        u   Text yticklabel(   R   R  R?   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_ymajorticklabels  s    		c         C` s   t  j d |  j j    S(   u   
        Get the minor y tick labels.

        Returns
        -------
        labels : list
            List of :class:`~matplotlib.text.Text` instances
        u   Text yticklabel(   R   R  R?   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yminorticklabels  s    		c         C` s%   t  j d |  j j d | d |   S(   u  
        Get the y tick labels as a list of :class:`~matplotlib.text.Text`
        instances.

        Parameters
        ----------
        minor : bool
           If True return the minor ticklabels,
           else return the major ticklabels

        which : None, ('minor', 'major', 'both')
           Overrides `minor`.

           Selects which ticklabels to return

        Returns
        -------
        ret : list
           List of :class:`~matplotlib.text.Text` instances.
        u   Text yticklabelR6  R   (   R   R  R?   R  (   R0   R6  R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_yticklabels  s    	c         K` s5   | d k	 r | j |  n  |  j j | d | | S(   uQ  
        Set the y-tick labels with list of strings labels.

        .. ACCEPTS: list of string labels

        Parameters
        ----------
        labels : list of str
            list of string labels

        fontdict : dict, optional
            A dictionary controlling the appearance of the ticklabels.
            The default `fontdict` is::

               {'fontsize': rcParams['axes.titlesize'],
                'fontweight': rcParams['axes.titleweight'],
                'verticalalignment': 'baseline',
                'horizontalalignment': loc}

        minor : bool, optional
            Whether to set the minor ticklabels rather than the major ones.

        Returns
        -------
        A list of `~.text.Text` instances.

        Other Parameters
        ----------------
        **kwargs : `~.text.Text` properties.
        R6  N(   R   Rj   R?   R  (   R0   R  R  R6  R=   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_yticklabels  s    c         C` s   |  j  j |  d S(   u   
        Sets up x-axis ticks and labels that treat the x data as dates.

        Parameters
        ----------
        tz : string or :class:`tzinfo` instance, optional
            Timezone string or timezone. Defaults to rc value.
        N(   R>   t	   axis_date(   R0   t   tz(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   xaxis_date;  s    c         C` s   |  j  j |  d S(   u   
        Sets up y-axis ticks and labels that treat the y data as dates.

        Parameters
        ----------
        tz : string or :class:`tzinfo` instance, optional
            Timezone string or timezone. Defaults to rc value.
        N(   R?   R  (   R0   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt
   yaxis_dateH  s    	c         C` sH   y |  j  |  SWn0 t k
 rC |  j j   j } | |  } | SXd S(   u   
        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   R?  R>   t   get_major_formattert   format_data_short(   R0   RX   R   t   val(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   format_xdataS  s    c         C` sH   y |  j  |  SWn0 t k
 rC |  j j   j } | |  } | SXd S(   u   
        Return y string formatted.  This function will use the
        :attr:`fmt_ydata` attribute if it is callable, else will fall
        back on the yaxis major formatter
        N(   R   R?  R?   R  R  (   R0   RY   R   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   format_ydata`  s    c         C` sV   | d k r d } n |  j |  } | d k r9 d } n |  j |  } d | | f S(   u4   Return a format string formatting the *x*, *y* coordu   ???u	   x=%s y=%sN(   R   R  R  (   R0   RX   RY   RU  RV  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   format_coordm  s    		c         C` s   x |  j  |  j f D] } | j   } | d k r\ | j } | j t j | j | j   q | d k r | j } | j t j	 | j
 | j   q | j t j    q Wd S(   u(   Add autoscaling minor ticks to the axes.u   logu   symlogN(   R>   R?   R<  R=  RB  RC  t
   LogLocatort   baset   subst   SymmetricalLogLocatort
   _transformRD  (   R0   R  R   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   minorticks_ony  s    	"	c         C` s0   |  j  j t j    |  j j t j    d S(   u!   Remove minor ticks from the axes.N(   R>   RB  RC  t   NullLocatorR?   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   minorticks_off  s    c         C` s   t  S(   uX   
        Return *True* if this axes supports the zoom box button functionality.
        (   Rw   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   can_zoom  s    c         C` s   t  S(   uX   
        Return *True* if this axes supports any pan/zoom button functionality.
        (   Rw   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   can_pan  s    c         C` s   |  j  S(   uF   
        Get whether the axes responds to navigation commands
        (   t	   _navigate(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_navigate  s    c         C` s   | |  _  d S(   u   
        Set whether the axes responds to navigation toolbar commands

        .. ACCEPTS: bool

        Parameters
        ----------
        b : bool
        N(   R  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    
c         C` s   |  j  S(   uR   
        Get the navigation toolbar button status: 'PAN', 'ZOOM', or None
        (   t   _navigate_mode(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_navigate_mode  s    c         C` s   | |  _  d S(   u   
        Set the navigation toolbar button status;

        .. warning::
            this is not a user-API function.

        N(   R  (   R0   Ry  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     s    c         C` s4   |  j    \ } } |  j   \ } } | | | | f S(   u  
        Save information required to reproduce the current view.

        Called before a view is changed, such as during a pan or zoom
        initiated by the user. You may return any information you deem
        necessary to describe the view.

        .. note::

            Intended to be overridden by new projection types, but if not, the
            default implementation saves the view limits. You *must* implement
            :meth:`_set_view` if you implement this method.
        (   R7  R@  (   R0   R  R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   _get_view  s    c         C` s<   | \ } } } } |  j  | | f  |  j | | f  d S(   um  
        Apply a previously saved view.

        Called when restoring a view, such as with the navigation buttons.

        .. note::

            Intended to be overridden by new projection types, but if not, the
            default implementation restores the view limits. You *must*
            implement :meth:`_get_view` if you implement this method.
        N(   R8  RA  (   R0   t   viewR  R  R  R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   _set_view  s    u   inc   &      C` s  |  j    \ } } |  j   \ } }	 t |  d k r\| \ }
 } } | d k rZ d } n  | d k ro d } n d } d | } |  j j } | | | f  \ } } | | |	 f  \ } } | | } | | } | | d } | | d } |
 | d | | } | | d | | } | | d | | | d | | | d | | | d | g } n# t |  d	 k rt j d
  d S| \ } } } } |  j j   } | j | | f  \ } } | j | | f  \ } } | r| | } } n | | k  rN| | k  r| | } } n | | } } | | k  r6| } n  | | k r| } qnS | | k rj| | } } n | | } } | | k r| } n  | | k  r| } n  | r| |	 } }  n | |	 k  r| | k  r| | } }  n | | } }  | | k  r| } n  |  |	 k rl|	 }  qlnS | | k r5| | } }  n | | } }  | | k rW| } n  |  |	 k  rl|	 }  n  | d k r| d k r|  j	 | | f  q| d k r|  j
 | |  f  q|  j	 | | f  |  j
 | |  f  n| d k r|  j   d k rXt j | |  t j | |  }! t | | |!  | }" t | | |!  | }# n6 | | | | }! |! | | | }" |! | | | }# |  j   d k rt j |	 |  t j |  |  }! t | | |!  | }$ t |	 | |!  | }% n6 |	 | |  | }! |! | | | }$ |! |	 | | }% | d k rM|  j	 |" |# f  q| d k ro|  j
 |$ |% f  q|  j	 |" |# f  |  j
 |$ |% f  n  d S(   u  
        Update view from a selection bbox.

        .. note::

            Intended to be overridden by new projection types, but if not, the
            default implementation sets the view limits to the bbox directly.

        Parameters
        ----------

        bbox : 4-tuple or 3 tuple
            * If bbox is a 4 tuple, it is the selected bounding box limits,
                in *display* coordinates.
            * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where
                (xp,yp) is the center of zooming and scl the scale factor to
                zoom by.

        direction : str
            The direction to apply the bounding box.
                * `'in'` - The bounding box describes the view directly, i.e.,
                           it zooms in.
                * `'out'` - The bounding box describes the size to make the
                            existing view, i.e., it zooms out.

        mode : str or None
            The selection mode, whether to apply the bounding box in only the
            `'x'` direction, `'y'` direction or both (`None`).

        twinx : bool
            Whether this axis is twinned in the *x*-direction.

        twiny : bool
            Whether this axis is twinned in the *y*-direction.
        i   i    g      ?i   u   inu   outg      ?g       @i   ug   Warning in _set_view_from_bbox: bounding box is not a tuple of length 3 or 4. Ignoring the view change.Nu   xu   yu   log(   R7  R@  R   R   R  R  R  R6  t   transform_pointR8  RA  R  RV   t   logt   powR  (&   R0   R   t	   directiont   modet   twinxt   twinyt   Xmint   Xmaxt   Ymint   Ymaxt   xpt   ypt   sclt   tranD2CR  R  R  R  t   xwidtht   ywidtht   xcent   ycent   xzct   yzct   lastxt   lastyRX   RY   t   inverseR   R   R   R   t   alphat   rx1t   rx2t   ry1t   ry2(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _set_view_from_bbox  s    %		


'						$$c         C` sa   t  j d |  j j   d |  j j   d |  j j   j   d |  j j   d | d |  |  _ d S(   u2  
        Called when a pan operation has started.

        *x*, *y* are the mouse coordinates in display coords.
        button is the mouse button number:

        * 1: LEFT
        * 2: MIDDLE
        * 3: RIGHT

        .. note::

            Intended to be overridden by new projection types.

        t   limt   transt   trans_inverseR   RX   RY   N(   R   t   BunchR   R   R   R6  R   t
   _pan_start(   R0   RX   RY   t   button(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt	   start_pan  s    	c         C` s
   |  `  d S(   u   
        Called when a pan operation completes (when the mouse button
        is up.)

        .. note::

            Intended to be overridden by new projection types.

        N(   R  (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   end_pan  s    
c         C` s  d   } |  j  } | | j } | | j } | d k rH | d k rH d S| d k r | | | |  \ } } | j j | |  j | j  }	 n| d k ry | |  j j } | |  j j } | | | |  \ } } |  j	   d k rd | | } } n  t
 j d | | f  }
 t
 j | j | j g  } | j j | j  } | |
 | | } t j |  j | j  }	 Wqt k
 rt j d	  d SXn  t
 j |	 j | j   } |	 j   j t  } d | | <|  j | d d  d f  |  j | d d  d f  d S(
   u`  
        Called when the mouse moves during a pan operation.

        *button* is the mouse button number:

        * 1: LEFT
        * 2: MIDDLE
        * 3: RIGHT

        *key* is a "shift" key

        *x*, *y* are the mouse coordinates in display coords.

        .. note::

            Intended to be overridden by new projection types.

        c         S` s  |  d k r6 t  |  t  |  k r- | } q| } n |  d k rK d } n |  d k r` d } n |  d k rd t  |  t  |  k  r d } qd t  |  t  |  k  r d } qt  |  t  |  k r | t  |  t  |  } q| t  |  t  |  } n  | | f S(   Nu   controlu   xi    u   yu   shifti   (   R  (   RX  t   dxt   dy(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   format_deltas  s"    						i    Ni   i   u   autog      ?g      $@u   Overflow while panning(   R  RX   RY   R   t
   translatedt   transformedR  R   R   R{  RV   t   powert   arrayR  R  R   R   t   OverflowErrorR  R  R0  R  t   astypet   objectR   R8  RA  (   R0   R  RX  RX   RY   R  Rf   R  R  t   resultR  t   startt	   oldpointst	   newpointst   validt   points(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   drag_pan  s<    		&c         C` s   |  j  S(   u   
        Return the cursor propertiess as a (*linewidth*, *color*)
        tuple, where *linewidth* is a float and *color* is an RGBA
        tuple
        (   t   _cursorProps(   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_cursor_props  s    c         G` st   t  |  d k r% | d \ } } n- t  |  d k rF | \ } } n t d   t j |  } | | f |  _ d S(   u   Set the cursor property as

        Call signature ::

          ax.set_cursor_props(linewidth, color)

        or::

          ax.set_cursor_props((linewidth, color))

        ACCEPTS: a (*float*, *color*) tuple
        i   i    i   u'   args must be a (linewidth, color) tupleN(   R   R   R   R   R  (   R0   R<   t   lwR'   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   set_cursor_props  s    c         C` s  g  } | j  |  j  | j  |  j  | j  |  j  | j  |  j  | j  |  j  | j  t j |  j   | j	 |  j
  | j	 |  j  | j	 |  j  | j	 |  j  | j	 |  j  | j  |  j  | j  |  j  |  j d k	 r| j	 |  j  n  | j	 |  j  | S(   u   return a list of child artistsN(   R3  RU  RN  R	  RO  RQ  Rq   R[  R   R   R>   R?   R\  R]  R^  RP  RR  RT  R   R1  (   R0   t   children(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyRO    s$    c         C` s/   t  |  j  r |  j |  |  S|  j j |  S(   uj   
        Test whether the mouse event occurred in the axes.

        Returns *True* / *False*, {}
        (   t   callablet	   _containsR1  R  (   R0   R  (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  "  s    c         C` s   |  j  j | d d S(   u   
        Returns *True* if the point (tuple of x,y) is inside the axes
        (the area defined by the its patch). A pixel coordinate is
        required.

        t   radiusg      ?(   R1  t   contains_point(   R0   t   point(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  ,  s    c         G` s   t  j j |  | d  d S(   u   Trigger pick event

        Call signature::

            pick(mouseevent)

        each child artist will fire a pick event if mouseevent is over
        the artist and the artist has picker set
        i    N(   R   R   t   pick(   R0   R<   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  5  s    
c         C` s)   g  |  j    D] } | j   r | ^ q S(   N(   RO  R2  (   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   get_default_bbox_extra_artistsA  s    c         C` s  g  } |  j    s d S|  j   } | rM | rM | |  |  } |  j |  n
 |  j   | j |  j |   |  j j    r | j |  j j |   n  |  j j    r | j |  j j |   n  |  j j    r | j |  j j |   n  |  j	 j
 |  } | r| j |  n  |  j j
 |  } | r>| j |  n  x |  j   D]q } t | t  r| j    r| j | j |   qKt | t  rK| j    rK| j | j j |   qKqKWt j j g  | D]* }	 |	 j d k s|	 j d k r|	 ^ q }
 |
 S(   u  
        Return the tight bounding box of the axes.
        The dimension of the Bbox in canvas coordinate.

        If *call_axes_locator* is *False*, it does not call the
        _axes_locator attribute, which is necessary to get the correct
        bounding box. ``call_axes_locator==False`` can be used if the
        caller is only intereted in the relative size of the tightbbox
        compared to the axes bbox.
        i    N(   R2  R   R  R  R   R   R\  R]  R^  R>   t   get_tightbboxR?   RO  R{   R   R   t   _legend_boxR   R   R  R   R   (   R0   Rh  t   call_axes_locatorRG  R  R  t   bb_xaxist   bb_yaxist   childRy  t   _bbox(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR  E  s:    
 	:c         O` sy   d | k r' d | k r' t  d   n  |  j j |  j t  | |  } |  j d  | j d  |  j j |  |  | S(   uN   
        Make a twinx axes of self. This is used for twinx and twiny.
        u   sharexu   shareyu%   Twinned Axes may share only one axis.u   datalim(   R   R   t   add_axesR  Rw   R~  R  R   (   R0   t   klR=   t   ax2(    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   _make_twin_axesy  s    !c         C` s   |  j  d |   } | j j   | j j d  | j j d  | j |  j    |  j j   | j j	 t
  | j j	 t
  | S(   u  
        Create a twin Axes sharing the xaxis

        Create a new Axes instance with an invisible x-axis and an independent
        y-axis positioned opposite to the original one (i.e. at right). The
        x-axis autoscale setting will be inherited from the original Axes.
        To ensure that the tick marks of both y-axes align, see
        `~matplotlib.ticker.LinearLocator`

        Returns
        -------
        ax_twin : Axes
            The newly created Axes instance

        Notes
        -----
        For those who are 'picking' artists while using twinx, pick
        events are only called for the artists in the top-most axes.
        R   u   right(   R!  R?   t
   tick_rightt   set_label_positiont   set_offset_positionR  R  t	   tick_leftR>   Rf  R9  R1  (   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    c         C` ss   |  j  d |   } | j j   | j j d  | j |  j    |  j j   | j j t	  | j
 j t	  | S(   u  
        Create a twin Axes sharing the yaxis

        Create a new Axes instance with an invisible y-axis and an independent
        x-axis positioned opposite to the original one (i.e. at top). The
        y-axis autoscale setting will be inherited from the original Axes.
        To ensure that the tick marks of both x-axes align, see
        `~matplotlib.ticker.LinearLocator`

        Returns
        -------
        ax_twin : Axes
            The newly created Axes instance

        Notes
        -----
        For those who are 'picking' artists while using twiny, pick
        events are only called for the artists in the top-most axes.
        R   u   top(   R!  R>   t   tick_topR#  R   R  t   tick_bottomR?   Rf  R9  R1  (   R0   R   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    c         C` s   |  j  S(   u@   Return a reference to the shared axes Grouper object for x axes.(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    c         C` s   |  j  S(   u@   Return a reference to the shared axes Grouper object for y axes.(   R   (   R0   (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR    s    N(   R   R   R   RB   R   t   GrouperR   R   R  R   R   t   SubstitutionR   R:  t   get_scale_namesRX   t   reprR   Rw   R1   R2   R6   R   R   R   R   R   R  R  R  R  R  R   R9  R  R  R  R  R   R  R   R"  R   R   t   propertyt
   deprecatedRo  Rp  Rq  t   get_fcR`  t   set_fcR_  R/   Rv  Rw  t	   _hold_msgRz  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  R   R  R  R  R  R  R  R  R  R  R  R   R!  t   setterR$  R%  R(  R*  R+  R-  R  RW  R   Rc  Rm  Rn  Ro  Rp  Rq  Rr  Rs  t   dedent_interpdRW  R  R  R   R  Rc  R  R  R  R  R7  R  R8  R  R   R  R  R  R  R  R  R  R  R  R  R@  RA  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  RO  R  R  R  R  R  R!  R  R  R  R  (    (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyR     sx  	(	
			
		'									
		!					I
 	H	/	:			z																	
	,						'										<		-d	T							#	])c							k		"		&				k		!		$											
					H			
				4				(N   t
   __future__R    R   R   R   RU  R   Rq   t	   six.movesR   R7   R  R  t   operatorR   t   numpyRV   R   R   t   matplotlib.cbookR   R	   R
   R   R   R   t   matplotlib.colorst   colorsR   t   matplotlib.linesR	  R   t   matplotlib.patchesRN  Rt   t   matplotlib.artistR   R   t   matplotlib.transformst
   transformsR   t   matplotlib.tickert   tickerRC  t   matplotlib.axisR*  R   t   matplotlib.scaleR   R:  t   matplotlib.spinesR   R#  t   matplotlib.font_managerRX  t   matplotlib.textR-  RZ  t   matplotlib.imageR  Re  t   matplotlib.offsetboxR   R   t   matplotlib.legendR   t   matplotlib.rcsetupR   R   R!   t   is_string_liket   is_sequence_of_stringsR0  R+   R  R,   R   R   (    (    (    s4   lib/python2.7/site-packages/matplotlib/axes/_base.pyt   <module>   sJ   "(				\ 