
 m[c        
   @` so  d  Z  d d l m Z m Z m 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 Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l 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# m$ Z$ m% Z% m& Z& d d l' Z' d d
 l( m) Z) d d l* m+ Z, d d l- m. Z. e/ e.   d  Z0 [. e j1 e2  Z3 e/ d  Z4 d Z5 e j6 j7 d k oe j6 j8 d k Z9 e j6 j7 d k oe j6 j8 d k Z: e9 p&e: s8e; d   n  e9 rTe3 j< e j=    n  d   Z> y d d l? Z? Wn e; k
 re; d   n Xe> e j0 d  se; d e j0   n  y d d l@ Z@ Wn e; k
 re; d   n) Xe> e@ j0 d  se; d e@ j0   n  e> e' j0 e4  s;e; d e4 e' j0 f   n  eA e d  s_e/ d  g e _B n  d   ZC d  ZD d! d" d#  ZE d$   ZF eF   d% eG f d&     YZH e jI    e jJ d'  eH   ZK Wd QXe jL eM d(  ZN d)   ZO d*   ZP d eP _R d eP _S e jT d+  d,    ZU d-   ZV d.   ZW d eW _S e jT d+  d/    ZX d0   ZY d1   ZZ d2   Z[ d3   Z\ eN d4 e[ d5 e] Z^ d6   Z_ d7   Z` d8   Za d9   Zb eN d: eb d5 e] Zc d;   Zd eN d< ed d5 e] Ze d=   Zf d>   Zg d?   Zh eN d@ eh d5 e] Zi dA   Zj dB   Zk i  Zl i dC dD 6Zm dE dF h Zn dG dH dI h Zo ep e jq em el en   Zr dJ e es f dK     YZt e] dL  Zu e jv dM  Zw dN   Zx dO   Zy e	 jz dP    Z{ dQ Z| e] dR  Z} e] eM dS  Z~ eu   Z e dT r`e j j e dT  s`e j j ek    \ Z Z e j j e  Z e j j e e dT  Z e e dT <q`n  e j   Z e jI   [ e jJ d' e  et g  e j e$  D]* \ Z \ Z Z e er k re e f ^ q Z Wd QXeY e dU  e dU <eZ e dV  e dV <e dW re j e j dX  n  dY   Z dZ   Z d[   Z d\   Z d] eG f d^     YZ d_ Z eM e] d`  Z y e e j da  Wn e k
 rn Xdb   Z dc   Z dd   Z de   Z df dg dh g Z di   Z d e] eM d dj  Z e] e _ dk   Z dl Z dm   Z d e] d d dn  Z e3 j do e0  e3 j dp e    e3 j dq e j  e3 j dr e e j   d S(s   s  
This is an object-oriented plotting library.

A procedural interface is provided by the companion pyplot module,
which may be imported directly, e.g.::

    import matplotlib.pyplot as plt

or using ipython::

    ipython

at your terminal, followed by::

    In [1]: %matplotlib
    In [2]: import matplotlib.pyplot as plt

at the ipython shell prompt.

For the most part, direct use of the object-oriented library is
encouraged when programming; pyplot is primarily for working
interactively.  The
exceptions are the pyplot commands :func:`~matplotlib.pyplot.figure`,
:func:`~matplotlib.pyplot.subplot`,
:func:`~matplotlib.pyplot.subplots`, and
:func:`~pyplot.savefig`, which can greatly simplify scripting.

Modules include:

    :mod:`matplotlib.axes`
        defines the :class:`~matplotlib.axes.Axes` class.  Most pylab
        commands are wrappers for :class:`~matplotlib.axes.Axes`
        methods.  The axes module is the highest level of OO access to
        the library.

    :mod:`matplotlib.figure`
        defines the :class:`~matplotlib.figure.Figure` class.

    :mod:`matplotlib.artist`
        defines the :class:`~matplotlib.artist.Artist` base class for
        all classes that draw things.

    :mod:`matplotlib.lines`
        defines the :class:`~matplotlib.lines.Line2D` class for
        drawing lines and markers

    :mod:`matplotlib.patches`
        defines classes for drawing polygons

    :mod:`matplotlib.text`
        defines the :class:`~matplotlib.text.Text`,
        :class:`~matplotlib.text.TextWithDash`, and
        :class:`~matplotlib.text.Annotate` classes

    :mod:`matplotlib.image`
        defines the :class:`~matplotlib.image.AxesImage` and
        :class:`~matplotlib.image.FigureImage` classes

    :mod:`matplotlib.collections`
        classes for efficient drawing of groups of lines or polygons

    :mod:`matplotlib.colors`
        classes for interpreting color specifications and for making
        colormaps

    :mod:`matplotlib.cm`
        colormaps and the :class:`~matplotlib.image.ScalarMappable`
        mixin class for providing color mapping functionality to other
        classes

    :mod:`matplotlib.ticker`
        classes for calculating tick mark locations and for formatting
        tick labels

    :mod:`matplotlib.backends`
        a subpackage with modules for various gui libraries and output
        formats

The base matplotlib namespace includes:

    :data:`~matplotlib.rcParams`
        a global dictionary of default configuration settings.  It is
        initialized by code which may be overridden by a matplotlibrc
        file.

    :func:`~matplotlib.rc`
        a function for setting groups of rcParams values

    :func:`~matplotlib.use`
        a function for setting the matplotlib backend.  If used, this
        function must be called immediately after importing matplotlib
        for the first time.  In particular, it must be called
        **before** importing pylab (if pylab is imported).

matplotlib was initially written by John D. Hunter (1968-2012) and is now
developed and maintained by a host of others.

Occasionally the internal documentation (python docstrings) will refer
to MATLAB&reg;, a registered trademark of The MathWorks, Inc.

i    (   t   absolute_importt   divisiont   print_functionN(   t   MutableMappingi   (   t   cbook(   t
   _backportst   mplDeprecationt   dedentt	   get_labelt   sanitize_sequence(   t
   subprocess(   t   defaultParamst   validate_backendt   cycler(   t   urlopen(   t   reload_module(   t   get_versionst   versions   1.7.1s  @Article{Hunter:2007,
  Author    = {Hunter, J. D.},
  Title     = {Matplotlib: A 2D graphics environment},
  Journal   = {Computing In Science \& Engineering},
  Volume    = {9},
  Number    = {3},
  Pages     = {90--95},
  abstract  = {Matplotlib is a 2D graphics package used for Python
  for application development, interactive scripting, and
  publication-quality image generation across user
  interfaces and operating systems.},
  publisher = {IEEE COMPUTER SOC},
  year      = 2007
}i   i   i   i   s.   Matplotlib requires Python 2.7 or 3.4 or laterc         C` s   |  r t  j rT t |  t  r0 |  j d  }  n  t | t  rT | j d  } qT n  t j j |   }  t j j |  } |  | k St Sd S(   s.   return True if a is greater than or equal to bt   asciiN(	   t   sixt   PY3t
   isinstancet   bytest   decodet	   distutilsR   t   LooseVersiont   False(   t   at   b(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   compare_versions   s    	
s   Matplotlib requires dateutils   1.10s*   Matplotlib requires six>=1.10; you have %ss   Matplotlib requires pyparsings   2.0.1s1   Matplotlib requires pyparsing>=2.0.1; you have %ss*   Matplotlib requires numpy>=%s; you have %st   argvt	   modpythonc         C` s%   t  j |  t  j  o$ t  j j |   S(   sm   
    p is a string pointing to a putative writable dir -- return True p
    is such a string, else False
    (   t   ost   accesst   W_OKt   patht   isdir(   t   p(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _is_writable_dir   s    s+  matplotlib.verbose is deprecated;
Command line argument --verbose-LEVEL is deprecated.
This functionality is now provided by the standard
python logging library.  To get more (or less) logging output:
    import logging
    logger = logging.getLogger('matplotlib')
    logger.set_level(logging.INFO)t   silents
   sys.stdoutc         C` s  i t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6t  j d 6} | |  } t j   } | | k  rt j |  i t j d 6t j	 d 6} | | k r | | } nF t j } y t
 | d	  } Wn' t k
 r t j d
 j |   n Xt  j |  } | j |  t j |  n  d S(   s@   
    Use a --verbose-LEVEL level to set the logging level:

    R'   t   helpfult   debugs   debug-annoyingt   infot   warnings
   sys.stdouts
   sys.stderrt   wsB   could not open log file "{0}"for writing.  Check your matplotlibrcN(   t   loggingt   WARNINGt   INFOt   DEBUGt   _logt   getEffectiveLevelt   setLevelt   syst   stdoutt   stderrt   opent   IOErrort   warningst   warnt   formatt   StreamHandlert
   addHandler(   t	   level_strt   file_strt   levelmapt   newlevt   oldlevt   stdt   fileot   console(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _set_logger_verbose_level   s*    

	c          C` sW   d }  xJ t  j d D]; } | j d  r | d	 } | |  k rO t |  qO q q Wd
 S(   sh   
    Check for --verbose-LEVEL type command line arguments and
    set logging level appropriately.
    R'   R(   R)   s   debug-annoyingR*   R+   i   s
   --verbose-i
   N(   R'   R(   R)   s   debug-annoyingR*   R+   (   R4   R   t
   startswithRF   (   t   levelst   argR>   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _parse_commandline  s     
t   Verbosec           B` s9  e  Z d  Z d Z d   e e  D Z d Z xI e j	 d D]: Z
 e
 j d  sW q< n  e
 d Z e e k r< e Z q< q< We j d	 d
 e d    Z e j d	 d
 e d    Z e j d	 d
 e d    Z e j d	 d
 e d d   Z e j d	 d
 e d e d   Z e j d	 d
 e d    Z RS(   s   
    A class to handle reporting.  Set the fileo attribute to any file
    instance to handle the output.  Default is sys.stdout
    R'   R(   R)   s   debug-annoyingc         C` s   i  |  ] \ } } | |  q S(    (    (   t   .0t   it   level(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys
   <dictcomp>)  s   	 i   s
   --verbose-i
   s   2.2t   messagec         C` s   |  j  d  t j |  _ d  S(   NR'   (   t	   set_levelR4   R5   RD   (   t   self(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   __init__9  s    c         C` sT   |  j  d k	 r |  j  } n  | |  j k rG t j d | |  j f  n	 | |  _ d S(   s6   set the verbosity to one of the Verbose.levels stringssE   matplotlib: unrecognized --verbose-* string "%s". Legal values are %sN(   t   _commandLineVerboset   NoneRH   R9   R:   RN   (   RQ   RN   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRP   >  s    	c         C` s   i t  j d 6t  j d 6} | | k r6 | | |  _ nE y t | d  } Wn& t k
 rq t d j |    n
 X| |  _ d  S(   Ns
   sys.stdouts
   sys.stderrR,   sg   Verbose object could not open log file "{0}" for writing.
Check your matplotlibrc verbose.fileo setting(   R4   R5   R6   RD   R7   R8   t
   ValueErrorR;   (   RQ   t   fnameRC   RD   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt	   set_fileoJ  s    
	c         C` s*   |  j  |  r& t | d |  j t St S(   s   
        print message s to self.fileo if self.level>=level.  Return
        value indicates whether a message was issued

        t   file(   t   get   printRD   t   TrueR   (   RQ   t   sRN   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   report\  s    c         ` sI   t    s t         f d    t  _  j  _  S(   s8  
        return a callable function that wraps func and reports it
        output through the verbose handler if current verbosity level
        is higher than level

        if always is True, the report will occur on every function
        call; otherwise only on the first time the function is called
        c          ` sQ    |  |   }   s  j  rM  j  |   }  j  sM |  _  qM n  | S(   N(   t   _spokeR]   (   t   argst   kwargst   rett   spoke(   t   alwayst   fmtt   funcRN   RQ   t   wrapper(    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRf   t  s    	(   t   callablet   AssertionErrorR   R^   t   __doc__(   RQ   Rd   Re   RN   Rc   (    (   Rc   Rd   Re   RN   RQ   Rf   s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   wraph  s
    
	c         C` s   |  j  |  j |  j  | k S(   s%   return true if self.level is >= level(   t   valdRN   (   RQ   RN   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRY     s    (   R'   R(   R)   s   debug-annoyingN(   t   __name__t
   __module__Ri   RH   t	   enumerateRk   RT   RS   R4   R   RI   RG   R>   R   t
   deprecatedt   _verbose_msgRR   RP   RW   R]   R[   Rj   RY   (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRK   #  s$   
t   ignorec         ` sF   t    s t        f d    t  _  j  _  S(   s   
    return a callable function that wraps func and reports its
    output through logger

    if always is True, the report will occur on every function
    call; otherwise only on the first time the function is called
    c          ` sU    |  |   }   s  j  rQ t j   |  t }  j  sQ |  _  qQ n  | S(   N(   R^   R1   t   logR[   (   R_   R`   Ra   Rb   (   Rc   Rd   Re   RN   Rf   (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRf     s    	(   Rg   Rh   R   R^   Ri   (   Rd   Re   RN   Rc   (    (   Rc   Rd   Re   RN   Rf   s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _wrap  s
    		c          C` s   ys t  j t d  d g d t  j d t  j }  |  j   \ } } | j d  j d  d } | j   d } | SWn t t t	 f k
 r d  SXd  S(	   Nt   dvipngs   -versionR5   R6   R   s   
i   i(   R
   t   Popent   strt   PIPEt   communicateR   t   splitt
   IndexErrorRU   t   OSErrorRT   (   R\   R5   R6   t   linet   v(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_dvipng  s    	c          C` s   t  j d  k r t j d k r3 d d d d g }  n	 d g }  x |  D] } yz t j t |  d g d t j d t j } | j	   \ } } | j
 d	 k r | d
  j d  } | t  _ | t  _ n  WqC t t t f k
 r qC XqC Wn  t  j t  j f S(   Nt   win32t   gswin32ct   gswin64ct   mgst   gss	   --versionR5   R6   i    iR   (   t   checkdep_ghostscriptt
   executableRT   R4   t   platformR
   Ru   Rv   Rw   Rx   t
   returncodeR   R   Rz   RU   R{   (   t   gs_execst   gs_execR\   R5   R6   R}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR     s"    		s   2.1c          C` s   y t  j t d  d g d t  j d t  j }  |  j   \ } } | j d  j d  d } d } t j | |  } | j	 d  } | SWn t
 t t t f k
 r d  SXd  S(	   Nt   texs   -versionR5   R6   R   s   
i    s   3\.1\d+(   R
   Ru   Rv   Rw   Rx   R   Ry   t   ret   searcht   groupRz   RU   t   AttributeErrorR{   RT   (   R\   R5   R6   R|   t   patternt   matchR}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_tex  s    !c          C` s   y t  j t d  d g d t  j d t  j }  |  j   \ } } | j d  j d  } x- | D]% } d | k ra | j   d } qa qa W| SWn t t t	 t
 f k
 r d  SXd  S(	   Nt   pdftopss   -vR5   R6   R   s   
R   i(   R
   Ru   Rv   Rw   Rx   R   Ry   Rz   RU   t   UnboundLocalErrorR{   RT   (   R\   R5   R6   t   linesR|   R}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_pdftops  s    !c          C` s   t  j d  k r y t j t d  d g d t j d t j }  |  j   \ } } | j d  j	 d  } x. | D]& } d | k rp | j	   d } Pqp qp W| t  _ Wq t
 t t t f k
 r q Xn  t  j S(	   Nt   inkscapes   -VR5   R6   R   s   
t   Inkscapei   (   t   checkdep_inkscapeR   RT   R
   Ru   Rv   Rw   Rx   R   Ry   Rz   RU   R   R{   (   R\   R5   R6   R   R|   R}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR     s    	c          C` s   y t  j t d  d g d t  j d t  j }  |  j   \ } } | j d  j d  } x. | D]& } d | k ra | j   d } Pqa qa W| SWn t t t	 t
 f k
 r d  SXd  S(	   Nt   xmllints	   --versionR5   R6   R   s   
R   i(   R
   Ru   Rv   Rw   Rx   R   Ry   Rz   RU   R   R{   RT   (   R\   R5   R6   R   R|   R}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_xmllint  s    	c         C` s   |  s
 t  St } d } t   \ } } t | |  sN t  } t j d |  n  |  d k r d } d } t   } t | |  r q t | |  r t | d  r q t  } t j d |  n  | r |  St  Sd  S(   Ns   8.60sn   matplotlibrc ps.usedistiller option can not be used unless ghostscript-%s or later is installed on your systemt   xpdfs   3.0s   0.9s   1.0sg   matplotlibrc ps.usedistiller can not be set to xpdf unless xpdf-%s or later is installed on your system(   R   R[   R   R   R9   R:   R   (   R\   t   flagt   gs_reqR   t   gs_vt   pdftops_reqt   pdftops_req_altt	   pdftops_v(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_ps_distiller  s0    			c         C` s   |  s
 t  Sd } d } t } t j d  d  k rG t  } t j d  n  t   } t | |  sy t  } t j d |  n  t	   \ } } t | |  s t  } t j d |  n  | S(   Ns   8.60s   1.6R   sV   matplotlibrc text.usetex option can not be used unless TeX is installed on your systemsp   matplotlibrc text.usetex can not be used with *Agg backend unless dvipng-%s or later is installed on your systemsc   matplotlibrc text.usetex can not be used unless ghostscript-%s or later is installed on your system(
   R   R[   R   t   whichRT   R9   R:   R~   R   R   (   R\   R   t
   dvipng_reqR   t   dvipng_vR   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   checkdep_usetex-  s&    			c          C` s   t  j r< t j d k r< t j j d  j t j    }  n t j j d  }  t j j	 |   rd |  SxB d D]: } t j
 j |  }  |  d k	 rk t j j	 |   rk |  Sqk Wd S(   s   Find user's home directory if possible.
    Otherwise, returns None.

    :see:
        http://mail.python.org/pipermail/python-list/2005-February/325395.html
    R   t   ~t   HOMEt   USERPROFILEt   TMP(   R   R   R   N(   R   t   PY2R4   R   R    R#   t
   expanduserR   t   getfilesystemencodingR$   t   environt   getRT   (   R#   t   evar(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt	   _get_homeK  s    $c          C` s4   t  j d d  }  t j d <t j t j |   |  S(   sW   
    If the config directory can not be created, create a temporary
    directory.
    t   prefixs   matplotlib-t   MPLCONFIGDIR(   t   tempfilet   mkdtempR    R   t   atexitt   registert   shutilt   rmtree(   t	   configdir(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _create_tmp_config_dir_  s    s   $HOME=%sRc   c          C` sR   t  j j d  }  |  d k rN t   }  |  d k	 rN t  j j |  d  }  qN n  |  S(   s   
    Returns the XDG configuration directory, according to the `XDG
    base directory spec
    <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
    t   XDG_CONFIG_HOMEs   .configN(   R    R   R   RT   t   get_homeR#   t   join(   R#   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_xdg_config_dirm  s    	c          C` sR   t  j j d  }  |  d k rN t   }  |  d k	 rN t  j j |  d  }  qN n  |  S(   s   
    Returns the XDG cache directory, according to the `XDG
    base directory spec
    <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
    t   XDG_CACHE_HOMEs   .cacheN(   R    R   R   RT   R   R#   R   (   R#   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_xdg_cache_dir{  s    	c         C` sI  d d l  m } t j j d  } | d  k	 rv t j j |  } t j j |  s_ | |  n  t	 |  sr t
   S| Sd  } t   } | d  k	 r t j j | d  } n  t j j d  r d  } |  d  k	 r t j j |  d  } q n  | d  k	 rBt j j |  rt	 |  r?| SqBy | |  Wn t k
 r:qBX| Sn  t
   S(	   Ni    (   t   mkdirsR   s   .matplotlibt   linuxt   freebsdt
   matplotlib(   R   R   (   t   matplotlib.cbookR   R    R   R   RT   R#   t   abspatht   existsR&   R   R   R   R4   R   RG   R{   (   t   xdg_baseR   R   R%   t   h(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_config_or_cache_dir  s6    	c           C` s   t  t    S(   s  
    Return the string representing the configuration directory.

    The directory is chosen as follows:

    1. If the MPLCONFIGDIR environment variable is supplied, choose that.

    2a. On Linux, follow the XDG specification and look first in
        `$XDG_CONFIG_HOME`, if defined, or `$HOME/.config`.

    2b. On other platforms, choose `$HOME/.matplotlib`.

    3. If the chosen directory exists and is writable, use that as the
       configuration directory.
    4. If possible, create a temporary directory, and use it as the
       configuration directory.
    5. A writable directory could not be found or created; return None.
    (   R   R   (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_configdir  s    s   CONFIGDIR=%sc           C` s   t  t    S(   s   
    Return the location of the cache directory.

    The procedure used to find the directory is the same as for
    _get_config_dir, except using `$XDG_CACHE_HOME`/`~/.cache` instead.
    (   R   R   (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_cachedir  s    s   CACHEDIR=%sc         C` s*   t  |  t  s" |  j t j    S|  Sd  S(   N(   R   Rv   R   R4   R   (   R#   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _decode_filesystem_path  s    c          C` s  d t  j k rA t  j d }  t  j j |   s= t d   n  |  St t  } t  j j t  j j	 |  d g  }  t  j j |   r |  Sd d l
 } t | j j  } t  j j t  j j	 |  d g  }  t  j j |   r |  St t d d  rt  j j	 t t j   } t  j j | d  }  t  j j |   r7|  St  j j t  j j |  d d  }  t  j j |   rr|  St  j j t j d d  }  t  j j |   r|  Sn  t d   d S(   s   get the path to matplotlib datat   MATPLOTLIBDATAs2   Path in environment MATPLOTLIBDATA not a directorys   mpl-datai    Nt   frozens(   Could not find the matplotlib data files(   R    R   R#   R$   t   RuntimeErrorR   t   __file__t   sepR   t   dirnamet   matplotlib.afmt   afmt   getattrR4   RT   R   Ry   (   R#   t   _fileR   t   exe_path(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_data_path  s4    $$%c           C` s4   t  d d d  k r( t   t  d d <n  t  d d S(   Nt   datapathi    (   R   RT   R   (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _get_data_path_cached  s    s   matplotlib data path %sc          C` s   t    }  t j j |   \ } } i  } x t j |   D] \ } } } d | k rb | j d  n  g  | D] } t j j | |  ^ qi } | j | d  } | | j d  } | | | <q7 Wt	 | j
    S(   Ns   Matplotlib.nibs   mpl-data(   t   get_data_pathR    R#   Ry   t   walkt   removeR   t   replacet   indext   listt   items(   R   t   _t   tailt   dt   roott   filest   filename(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   get_py2exe_datafiles  s    	(c          C` sj   d   }  xZ |    D]O } t  j j |  r t  j |  j } t j |  s[ t j |  rb Pqb q q W| S(   s  
    Get the location of the config file.

    The file location is determined in the following order

    - `$PWD/matplotlibrc`

    - `$MATPLOTLIBRC` if it is a file (or a named pipe, which can be created
      e.g. by process substitution)

    - `$MATPLOTLIBRC/matplotlibrc`

    - `$MPLCONFIGDIR/matplotlibrc`

    - On Linux,

          - `$XDG_CONFIG_HOME/matplotlib/matplotlibrc` (if
            $XDG_CONFIG_HOME is defined)

          - or `$HOME/.config/matplotlib/matplotlibrc` (if
            $XDG_CONFIG_HOME is not defined)

    - On other platforms,

         - `$HOME/.matplotlib/matplotlibrc` if `$HOME` is defined.

    - Lastly, it looks in `$MATPLOTLIBDATA/matplotlibrc` for a
      system-defined copy.
    c          s` s   t  j j t j j   d  Vy t  j d }  Wn t k
 rA n X|  Vt  j j |  d  Vt  j j t   d  Vt  j j t	   d  Vd  S(   Nt   matplotlibrct   MATPLOTLIBRC(
   R    R#   R   R   t   movest   getcwdR   t   KeyErrorR   R   (   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   gen_candidates<  s    (   R    R#   R   t   statt   st_modet   S_ISREGt   S_ISFIFO(   R   RV   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   matplotlib_fname  s    	s   figure.facecolors   nbagg.transparents   plugins.directorys   text.dvipnghacks	   axes.holds   backend.qt4s   backend.qt5t   RcParamsc           B` s   e  Z d  Z e d   e j e  D  Z d Z d Z	 d Z
 d Z d Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z RS(   s   
    A dictionary object including validation

    validating functions are defined and associated with rc parameters in
    :mod:`matplotlib.rcsetup`
    c         c` s3   |  ]) \ } \ } } | t  k r | | f Vq d  S(   N(   t   _all_deprecated(   RL   t   keyt   defaultt	   converter(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>n  s    s=   %s is deprecated and replaced with %s; please use the latter.sM   %s is deprecated. Please remove it from your matplotlibrc and/or style files.s-   %s is deprecated and ignored. Use %s instead.sK   %s is obsolete. Please remove it from your matplotlibrc and/or style files.s   The {} rcParam was deprecated in version 2.2.  In order to force the use of a specific Qt binding, either import that binding first, or set the QT_API environment variable.c         O` s   |  j  | |   d  S(   N(   t   update(   RQ   R_   R`   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRR   }  s    c   	      C` s  yr| t  k rT t  | \ } } } t j |  j | | f t  | } | |  } n | t k r | d  k	 r | j d  r t j |  j j	 |  t  qt j |  j
 | t  na | t k r t | } t j |  j | | f t  d  S| t k rt j |  j | f t  d  Sy |  j | |  } Wn/ t k
 r]} t d | t |  f   n Xt j |  | |  Wn$ t k
 rt d | f   n Xd  S(   Nt   backends
   Key %s: %ssS   %s is not a valid rc parameter. See rcParams.keys() for a list of valid parameters.(   t   _deprecated_mapR9   R:   t   msg_deprR   t   _deprecated_setRT   RG   t   msg_backend_obsoleteR;   t   msg_depr_sett   _deprecated_ignore_mapt   msg_depr_ignoret   _obsolete_sett   msg_obsoletet   validateRU   Rv   t   dictt   __setitem__R   (	   RQ   R   t   valt   alt_keyt   alt_valt   inverse_altt   altt   cvalt   ve(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR    s>    


 c         C` s   d  } | t k rK t | \ } } } t j |  j | | f t  | } nf | t k r t | } t j |  j | | f t  | } n* | t k r t j |  j	 | f t  d  St
 j |  |  } | d  k	 r | |  S| Sd  S(   N(   RT   R   R9   R:   R   R   R  R  R  R  R  t   __getitem__(   RQ   R   R  R
  R  R  R	  (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR    s&    	
	
c         C` s}   d d  l  } |  j j } t |  d } | j t |   d d d d | j d  } d d | j |  } d j | |  S(	   Ni    i   t   indentt   widthiP   s   
t    s   {0}({1})(	   t   pprintt	   __class__Rl   t   lent   pformatR  Ry   R   R;   (   RQ   R  t
   class_nameR  t
   repr_splitt   repr_indented(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   __repr__  s    c         C` s#   d j  d   t |  j    D  S(   Ns   
c         s` s'   |  ] \ } } d  j  | |  Vq d S(   s   {0}: {1}N(   R;   (   RL   t   kR}   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>  s   (   R   t   sortedR   (   RQ   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   __str__  s    c         c` s)   x" t  t j |    D] } | Vq Wd S(   s,   
        Yield sorted list of keys.
        N(   R  R  t   __iter__(   RQ   R  (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR    s    c         ` s/   t  j |    t   f d   |  j   D  S(   s  
        Return the subset of this RcParams dictionary whose keys match,
        using :func:`re.search`, the given ``pattern``.

        .. note::

            Changes to the returned dictionary are *not* propagated to
            the parent RcParams dictionary.

        c         3` s0   |  ]& \ } }   j  |  r | | f Vq d  S(   N(   R   (   RL   R   t   value(   t
   pattern_re(    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>  s   	(   R   t   compileR   R   (   RQ   R   (    (   R!  s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   find_all  s    (   Rl   Rm   Ri   R  R   t	   iteritemsR   R  R   R  R  R  R   RR   R  R  R  R  R  R#  (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR   e  s   			"					c         C` s   t    } t j j |  sx d } t g  t j t  D]* \ } \ } } | t k r4 | | f ^ q4  } t	 j
 |  | St | |   S(   s\   Return a :class:`matplotlib.RcParams` instance from the
    default matplotlib rc file.
    s*   could not find rc file; returning defaults(   R   R    R#   R   R   R   R$  R   R   R9   R:   t   rc_params_from_file(   t   fail_on_errorRV   RO   R   R   R   Ra   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt	   rc_params  s    	!s'   http://|https://|ftp://|file://|file:\\c         C` s   t  j |   d k	 S(   s8   Return True if string is an http, ftp, or file URL path.N(   t	   URL_REGEXR   RT   (   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   is_url  s    c         c` s#   x |  D] } | j  d  Vq Wd  S(   Nt   utf8(   R   (   t   fR|   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt
   _url_lines  s    c         c` s   t  |   r0 t |   } t |  V| j   n\ t j j |   }  t j d t	  } | d  k ri d } n  t j |  d |  } | VWd  QXd  S(   Nt   do_setlocales   utf-8t   encoding(   R)  R   R,  t   closeR    R#   R   t   localet   getpreferredencodingR   RT   t   ioR7   (   RV   R+  R.  (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _open_file_or_url  s    	s   line #%d
	"%s"
	in file "%s"c      
   C` s  d } i  } t  |   9} y x | D] } | d 7} | j d d  d j   } | s] q% n  | j d d  } t |  d k r t | | |  f } t j d |  q% n  | \ }	 }
 |	 j   }	 |
 j   }
 |	 | k r t j d |  | f  n  |
 | | f | |	 <q% WWn= t k
 rLt j d |  t j	 d	 t
  p>d
 f    n XWd QXt   } x d D] }	 |	 | k rc| j |	  \ }
 } } | r|
 | |	 <qy |
 | |	 <Wqt k
 r} t | | |  f } t j d |
 | | f  qXqcqcWx t j |  D] \ }	 \ }
 } } |	 t k r| r<|
 | |	 <qy |
 | |	 <Wqt k
 r} t | | |  f } t j d |
 | | f  qXq|	 t k rt j d |	 t |	 f t  qt d |	 | |  f d t j qW| S(   s   Return :class:`matplotlib.RcParams` from the contents of the given file.

    Unlike `rc_params_from_file`, the configuration class only contains the
    parameters specified in the file (i.e. default values are not filled in).
    i    i   t   #t   :i   s
   Illegal %ss$   Duplicate key in file "%s", line #%dsS   Cannot decode configuration file %s with encoding %s, check LANG and LC_* variablesR-  s   utf-8 (default)Ns   verbose.levels   verbose.fileos   Bad val "%s" on %s
	%ss=   %s is deprecated. Update your matplotlibrc to use %s instead.s   
Bad key "%s" on line %d in
%s.
You probably need to get an updated matplotlibrc file from
http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template
or from the matplotlib source distributionRX   (   s   verbose.levels   verbose.fileo(   R3  Ry   t   stripR  t   _error_details_fmtR9   R:   t   UnicodeDecodeErrorR0  R1  R   R   t   popt	   ExceptionR   R$  R   R  R   RZ   R4   R6   (   RV   R&  t   cntt   rc_tempt   fdR|   t   strippedlinet   tupt   error_detailsR   R	  t   configt   msg(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _rc_params_in_file  sr    
			%		
c   	   	   C` s   t  |  |  } | s | St j t  } t j   R t j d t  t g  | D]* \ } \ } } | t	 k rO | | f ^ qO  } Wd QX| j
 |  | d d k r t   | d <n  d j | d  r t j d d j | d   n  t j d |   | S(	   s  Return :class:`matplotlib.RcParams` from the contents of the given file.

    Parameters
    ----------
    fname : str
        Name of file parsed for matplotlib settings.
    fail_on_error : bool
        If True, raise an error when the parser fails to convert a parameter.
    use_default_template : bool
        If True, initialize with default parameters before updating with those
        in the given file. If False, the configuration class only contains the
        parameters specified in the file. (Useful for updating dicts.)
    Rq   NR   t    s   text.latex.preambles
  
*****************************************************************
You have the following UNSUPPORTED LaTeX preamble customizations:
%s
Please do not ask for support with these customizations active.
*****************************************************************
s   
s   loaded rc file %s(   RC  R   R$  R   R9   t   catch_warningst   simplefilterR   R   R   R   RT   R   R   R1   R*   R)   (	   RV   R&  t   use_default_templatet   config_from_filet   iter_paramsR   R   R   RA  (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyR%  _  s     's   examples.directorys   ps.usedistillers   text.usetexs   axes.formatter.use_localeRD  c         K` s   i d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6} t  |  t j  rU |  f }  n  x |  D] } x} t j |  D]l \ } } | j |  p | } d | | f } y | t | <Wqr t k
 r t d | | | f   qr Xqr Wq\ Wd S(   s  
    Set the current rc params.  Group is the grouping for the rc, e.g.,
    for ``lines.linewidth`` the group is ``lines``, for
    ``axes.facecolor``, the group is ``axes``, and so on.  Group may
    also be a list or tuple of group names, e.g., (*xtick*, *ytick*).
    *kwargs* is a dictionary attribute name/value pairs, e.g.,::

      rc('lines', linewidth=2, color='r')

    sets the current rc params and is equivalent to::

      rcParams['lines.linewidth'] = 2
      rcParams['lines.color'] = 'r'

    The following aliases are available to save typing for interactive
    users:

    =====   =================
    Alias   Property
    =====   =================
    'lw'    'linewidth'
    'ls'    'linestyle'
    'c'     'color'
    'fc'    'facecolor'
    'ec'    'edgecolor'
    'mew'   'markeredgewidth'
    'aa'    'antialiased'
    =====   =================

    Thus you could abbreviate the above rc command as::

          rc('lines', lw=2, c='r')


    Note you can use python's kwargs dictionary facility to store
    dictionaries of default parameters.  e.g., you can customize the
    font rc as follows::

      font = {'family' : 'monospace',
              'weight' : 'bold',
              'size'   : 'larger'}

      rc('font', **font)  # pass in the font dict as kwargs

    This enables you to easily switch between several configurations.  Use
    ``matplotlib.style.use('default')`` or :func:`~matplotlib.rcdefaults` to
    restore the default rc params after changes.
    t	   linewidtht   lwt	   linestylet   lst   colort   ct	   facecolort   fct	   edgecolort   ect   markeredgewidtht   mewt   antialiasedt   aas   %s.%ss2   Unrecognized key "%s" for group "%s" and name "%s"N(   R   R   t   string_typesR$  R   t   rcParamsR   (   R   R`   t   aliasest   gR  R}   t   nameR   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   rc  s&    2
c           C` s   t  j   t  j t  d S(   sD  Restore the rc params from Matplotlib's internal defaults.

    See Also
    --------
    rc_file_defaults :
        Restore the rc params from the rc file originally loaded by Matplotlib.
    matplotlib.style.use :
        Use a specific style file.  Call ``style.use('default')`` to restore
        the default style.
    N(   RY  t   clearR   t   rcParamsDefault(    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt
   rcdefaults  s    
c           C` s   t  j t  d S(   sJ   Restore the rc params from the original rc file loaded by Matplotlib.
    N(   RY  R   t   rcParamsOrig(    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   rc_file_defaults  s    c         C` s   t  j t |    d S(   s%   
    Update rc params from file.
    N(   RY  R   R%  (   RV   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   rc_file	  s    t
   rc_contextc           B` s/   e  Z d  Z d d d  Z d   Z d   Z RS(   s  
    Return a context manager for managing rc settings.

    This allows one to do::

        with mpl.rc_context(fname='screen.rc'):
            plt.plot(x, a)
            with mpl.rc_context(fname='print.rc'):
                plt.plot(x, b)
            plt.plot(x, c)

    The 'a' vs 'x' and 'c' vs 'x' plots would have settings from
    'screen.rc', while the 'b' vs 'x' plot would have settings from
    'print.rc'.

    A dictionary can also be passed to the context manager::

        with mpl.rc_context(rc={'text.usetex': True}, fname='screen.rc'):
            plt.plot(x, a)

    The 'rc' dictionary takes precedence over the settings loaded from
    'fname'.  Passing a dictionary only is also valid. For example a
    common usage is::

        with mpl.rc_context(rc={'interactive': False}):
            fig, ax = plt.subplots()
            ax.plot(range(3), range(3))
            fig.savefig('A.png', format='png')
            plt.close(fig)
    c         C` sj   t  j   |  _ y- | r% t |  n  | r; t  j |  n  Wn' t k
 re t j t  |  j    n Xd  S(   N(   RY  t   copyt   _origRc  R   R:  R  (   RQ   R]  RV   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRR   7  s    c         C` s   |  S(   N(    (   RQ   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt	   __enter__C  s    c         C` s   t  j t |  j  d  S(   N(   R  R   RY  Rf  (   RQ   t   exc_typet	   exc_valuet   exc_tb(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   __exit__F  s    N(   Rl   Rm   Ri   RT   RR   Rg  Rk  (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRd    s   		s!  
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to {backend!r} by the following code:
{tb}
c         C` s   |  j  d  r |  } n |  j   }  t |   } d t j k r t d | k r | r d d l } t j t	 j
 d t d d | j j  d d n  | s d St } n t } | t d <| r t t j d  n  d S(	   s  
    Set the matplotlib backend to one of the known backends.

    The argument is case-insensitive. *warn* specifies whether a
    warning should be issued if a backend has already been set up.
    *force* is an **experimental** flag that tells matplotlib to
    attempt to initialize a new backend by reloading the backend
    module.

    .. note::

        This function must be called *before* importing pyplot for
        the first time; or, if you are not using pyplot, it must be called
        before importing matplotlib.backends.  If warn is True, a warning
        is issued if you try and call this after pylab or pyplot have been
        loaded.  In certain black magic use cases, e.g.
        :func:`pyplot.switch_backend`, we are doing the reloading necessary to
        make the backend switch work (in some cases, e.g., pure image
        backends) so one can set warn=False to suppress the warnings.

    To find out which backend is currently set, see
    :func:`matplotlib.get_backend`.

    s	   module://s   matplotlib.backendsR   i    Nt   tbt
   stackleveli   (   RG   t   lowerR   R4   t   modulesRY  t   matplotlib.backendsR9   R:   t   _use_error_msgR;   t   backendst   _backend_loading_tbR[   R   t   reload(   RI   R:   t   forceR\  R   t   need_reload(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   useU  s&    		

	
t
   MPLBACKENDc           C` s   t  d S(   s'   Return the name of the current backend.R   (   RY  (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   get_backend  s    c         C` s   |  t  d <d S(   sz   
    Set interactive mode to boolean b.

    If b is True, then draw after every plotting command, e.g., after xlabel
    t   interactiveN(   RY  (   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyRz    s    c           C` s   t  d S(   s'   Return true if plot mode is interactiveRz  (   RY  (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   is_interactive  s    c           C` s   t  d d k r t St  d S(   s   Return true if focus maintenance under TkAgg on win32 is on.
     This currently works only for python.exe and IPython.exe.
     Both IDLE and Pythonwin.exe fail badly when tk_window_focus is on.R   t   TkAggs   tk.window_focus(   RY  R   (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   tk_window_focus  s    s   matplotlib.testss   matplotlib.sphinxext.testss   mpl_toolkits.testsc          C` sQ  y d d  l  }  Wn t k
 r# nZ Xd d  l } t j d k om d t j k  oY d k  n om | j   d k s} |  j   n  d } d d l m } | j	 | k s | j
 d	 k r t j d
 j | | j	 | j
 d	 k r d n d   n  yD d d  l } y d d l m } Wn t k
 r*d d  l } n XWn t k
 rLt d    n Xd  S(   Ni    R   i   i   i   t   CPythons   2.6.1(   t   ft2fontt   locals  Matplotlib is not built with the correct FreeType version to run tests.  Set local_freetype=True in setup.cfg and rebuild. Expect many image comparison failures below. Expected freetype version {0}. Found freetype version {1}. Freetype build type is {2}localRD  s   not (   t   mocks0   matplotlib.test requires pytest and mock to run.(   i   i   (   i   i   i   (   t   faulthandlert   ImportErrorR   R4   t   version_infot   python_implementationt   enableR   R  t   __freetype_version__t   __freetype_build_type__R9   R:   R;   t   pytestt   unittestR  RZ   (   R  R   t   LOCAL_FREETYPE_VERSIONR  R  R  (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _init_tests  s6    "
c         ` s  t    t j j t j j t j j t  d   sC t d   n  t   } t	 j
   } zt d  | r{ t	 j |  n  d d l } | j d g   } t }	 t }
 xV | D]N   t   f d   t D  r t }	 Pn  t j j    r t }	 t }
 Pq q W|
 r| d g 7} n  |	 r'| t 7} n  | r=| d	 g 7} n  |  r[| d
 d |  g 7} n  | j | |  } Wd | j   d k rt | d | n  | rt	 j |  n  X| S(   s   run the matplotlib test suitet   testss%   Matplotlib test data is not installedt   aggi    NR   c         3` s   |  ] }   j  |  Vq d  S(   N(   RG   (   RL   t   module_path(   RI   (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>  s   s   --pyargss   --covt   -R}   R:   (   R  R    R#   R$   R   R   R   R  Ry  R4   t   getrecursionlimitRw  t   setrecursionlimitR  R9  R[   t   anyt   default_test_modulesR   R   t   mainRn  (   t	   verbosityt   coveraget   switch_backend_warnt   recursionlimitR`   t   old_backendt   old_recursionlimitR  R_   t   provide_default_modulest
   use_pyargst   retcode(    (   RI   s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   test  sH    -	
c         C` sA   t  | t j  s | Sy t |  |  SWn t k
 r< | SXd S(   sh   Either returns data[key] or passes data back. Also
    converts input data to a sequence as needed.
    N(   R   R   RX  R	   R   (   t   dataR   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt	   _replacer  s    s   

.. note::
    In addition to the above described arguments, this function can take a
    **data** keyword argument. If such a **data** argument is given, the
    following arguments are replaced by **data[<arg>]**:

    {replaced}
c         C` s   |  d	 k r d }  n t |   }  d } | d	 k r< d } nO t |  d k rW d } n  | rj | d 7} n  | j d d j t |    } |  t j d |  S(
   s$  Add documentation for a *data* field to the given docstring.

    Parameters
    ----------
    docstring : str
        The input docstring.
    replace_names : list of strings or None
        The list of parameter names which arguments should be replaced by
        `data[name]`. If None, all arguments are replaced if they are
        included in `data`.
    replace_all_args : bool
        If True, all arguments in *args get replaced, even if they are not
        in replace_names.

    Returns
    -------
        The augmented docstring.
    RD  s+   * All positional and all keyword arguments.i    s4   * All arguments with the following names: '{names}'.s    
    * All positional arguments.t   namess   ', 't   replacedN(   RT   R   R  R;   R   R  t   _DATA_DOC_APPENDIX(   t	   docstringt   replace_namest   replace_all_argst   _repl(    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _add_data_doc5  s    			!c         ` s7    d k	 r t    n       f d   } | S(   s  
    A decorator to add a 'data' kwarg to any a function.  The signature
    of the input function must include the ax argument at the first position ::

       def foo(ax, *args, **kwargs)

    so this is suitable for use with Axes methods.

    Parameters
    ----------
    replace_names : list of strings, optional, default: None
        The list of parameter names which arguments should be replaced by
        `data[name]`. If None, all arguments are replaced if they are
        included in `data`.
    replace_all_args : bool, default: False
        If True, all arguments in *args get replaced, even if they are not
        in replace_names.
    label_namer : string, optional, default: None
        The name of the parameter which argument should be used as label, if
        label is not set. If None, the label keyword argument is not set.
    positional_parameter_names : list of strings or callable, optional
        The full list of positional parameter names (excluding an explicit
        `ax`/'self' argument at the first place and including all possible
        positional parameter in `*args`), in the right order. Can also include
        all other keyword parameter. Only needed if the wrapped function does
        contain `*args` and (replace_names is not None or replace_all_args is
        False). If it is a callable, it will be called with the actual
        tuple of *args and the data and should return a list like
        above.
        NOTE: callables should only be used when the names and order of *args
        can only be determined at runtime. Please use list of names
        when the order and names of *args is clear before runtime!

    .. note:: decorator also converts MappingView input data to list.
    c      
   ` s  d  } t j } } | rt d t j k rt y. d d  l } | j j j } | j j j	 } Wn t
 k
 rj q Xt } n | r t j } t j	 } n  | s t j   } | j } | j d  k	 }	 | j d  k	 }
 n |   } t }	 t }
 g  } t | j j    } xT | D]L } | j | j k r)t }	 q| j | j k rDt }
 q| j | j  qW| d | j d d  } |
 r| j d |  n | j |  | j d |  } t  |	 s| d   n  d  k rd    n t   d k rg    n t |  d k rW d  k rWt  t | d   d k r<| d   qt d j   j!    nW  d  k	 rt"   r~t  g    q   n'  rg    n t d	 j   j!    d
  d
   r  r   k r  j#    d   k r  j# d   qn   r^ r^|
 r^  s4t d j      q^   k r^t d j        q^n  t$ j%             f	 d    } t& | j'    | _' | s | _( n  | d  k	 r| | _) n  | S(   Nt   IPythoni    R  R   it
   parametersi   se   Got unknown 'replace_names' and wrapped function {!r} uses '*args', need 'positional_parameter_names'sq   Got 'replace_names' and wrapped function {!r} uses *args, need 'positional_parameter_names' or 'replace_all_args'i'  t   labelsU   label_namer {!r} can't be found as the parameter without 'positional_parameter_names'sL   label_namer {!r} can't be found in the parameter names (known argnames: %s).c         ` s   }  }    d  } | j d d     d  k rO t d   | D  } n r  |      r   r    k r   j   } d   k r  j d  } q q n  | t |  k  r | | } n | j  d   } t | t j  s d  } n  
 d  k s	 t	 k r8t  f d   t
 |  D  } nO t    t |  k  r_t d   n  t    
 f d   t
 |  D  } 
 d  k rt  f d   t j |  D  } n( t  
 f d   t j |  D  } t |  | k pd | k }  r| r| t |  k  r:t | | |  | d <q | k r`t |  |  | d <qt j d	   j f t d
 d n   |  | |  S(   NR  c         s` s   |  ] } t  |  Vq d  S(   N(   R	   (   RL   R   (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>	  s    R  c         3` s$   |  ] \ } } t    |  Vq d  S(   N(   R  (   RL   t   jR   (   R  (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>"  s   s#   Got more args than function expectsc         3` s:   |  ]0 \ } }   |  k r. t   |  n | Vq d  S(   N(   R  (   RL   R  R   (   t
   _arg_namesR  R  (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>*  s   c         3` s*   |  ]  \ } } | t    |  f Vq d  S(   N(   R  (   RL   R  R}   (   R  (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>0  s   c         3` s<   |  ]2 \ } } | |  k r- t    |  n | f Vq d  S(   N(   R  (   RL   R  R}   (   R  R  (    s2   lib/python2.7/site-packages/matplotlib/__init__.pys	   <genexpr>4  s   s   Tried to set a label via parameter %r in func %r but couldn't find such an argument.
(This is a programming error, please report to the Matplotlib list!)Rm  i   (   RT   R9  t   tupleR   R  R   R   R   RX  R[   Rn   R   R  R$  R   R9   R:   Rl   t   RuntimeWarning(   t   axR_   R`   t
   _label_post   _label_namer_posR  t   user_supplied_label(	   t	   arg_namest   arg_names_at_runtimeRe   t   label_namert   label_namer_post	   label_post   positional_parameter_namesR  R  (   R  R  s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   inner  sZ    	(*   RT   R   R   R4   Ro  t   IPython.utils.signaturest   utilst
   signaturest	   signaturet	   ParameterR  R[   t   inspectt
   getargspecR_   t   varargst   keywordsR   R   R  t   valuest   kindt   VAR_POSITIONALt   VAR_KEYWORDt   appendR\  t   KEYWORD_ONLYt   insertR   R  t   setRh   R;   Rl   Rg   R   t	   functoolst   wrapsR  Ri   t   __wrapped__t   __signature__(   Re   t   new_sigt   python_has_signaturet   python_has_wrappedR  R  R  t   arg_specR  t   _has_varargst   _has_varkwargst   sigt   paramsR%   t
   data_paramR  (   R  R  R  R  (   R  R  Re   R  R  s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   param  s    									 			6S	N(   RT   R  (   R  R  R  R  R  (    (   R  R  R  R  s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   _preprocess_dataX  s    %s   matplotlib version %ss   interactive is %ss   platform is %ss   loaded modules: %s(   Ri   t
   __future__R    R   R   R   R   t   collectionsR   t
   contextlibt   distutils.versionR   R  R2  R  t	   itertoolsR0  R-   R    R   R   R   R4   R   R9   RD  R   R   R   R   R   R   R	   t   matplotlib.compatR
   t   matplotlib.rcsetupR   R   R   t   numpyt   six.moves.urllib.requestR   t	   six.movesR   Rt  t   _versionR   Rv   t   __version__t	   getLoggerRl   R1   t   __version__numpy__t
   __bibtex__R  t   majort   minort	   _python27t	   _python34R  R=   t   NullHandlerR   t   dateutilt	   pyparsingt   hasattrR   R&   Rp   RF   RJ   t   objectRK   RE  RF  t   verboseR0   R[   Rs   R~   R   RT   R   R   Ro   R   R   R   R   R   R   R   R   R   R   R   R   R   R   t   get_configdirR   t   get_cachedirR   R   R   R   R   R   R   R  R  R   R  t   chainR   R  R   R'  R"  R(  R)  R,  t   contextmanagerR3  R7  RC  R%  RY  R#   t   isabsRy   t   _basedirt   _fnamet   realpathR   t	   _fullpathRe  Ra  R$  R   R   R   R_  t	   setlocalet   LC_ALLR]  R`  Rb  Rc  Rd  Rq  Rw  R   R   Ry  Rz  R{  R}  R  R  R  t   __test__R  R  R  R  R)   R   R   Ro  (    (    (    s2   lib/python2.7/site-packages/matplotlib/__init__.pyt   <module>e   sH  ($$		#	c								"						%					+				8		{		N+	
'
	I			B<					
		.	/			#