
 m[c           @` s  d  Z  d d l m Z m Z m Z 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 Z d d l Z d d l Z d d l m Z d d l Z d d l Z e j s d d l Z n  d d l m Z d d l m Z e j Z d d l Z e j j d  Z e g  e d	  D]" Z e  e j d
 e  d  ^ q! Z d d l! Z! d d l" Z" d d l# j$ Z$ y: e j% d e&  " e j' d e(  e" j) d  Wd QXWn- e( k
 rd d l* j+ Z, e, j- d  n Xd d l* j+ Z, d d l" m. Z. d	 Z d   Z/ d   Z0 d   Z1 d   Z2 d   Z3 d   Z4 d   Z5 d   Z6 d   Z7 d   Z8 d   Z9 d Z: d Z; e<   Z= d e> f d     YZ? d   Z@ d eA f d      YZB d d d!  ZD e& d"  ZE d#   ZF eG eG d$  ZH d%   ZI d S(&   u  
A directive for including a matplotlib plot in a Sphinx document.

By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf.  In LaTeX output, it will include a
.pdf.

The source code for the plot may be included in one of three ways:

  1. **A path to a source file** as the argument to the directive::

       .. plot:: path/to/plot.py

     When a path to a source file is given, the content of the
     directive may optionally contain a caption for the plot::

       .. plot:: path/to/plot.py

          This is the caption for the plot

     Additionally, one may specify the name of a function to call (with
     no arguments) immediately after importing the module::

       .. plot:: path/to/plot.py plot_function1

  2. Included as **inline content** to the directive::

       .. plot::

          import matplotlib.pyplot as plt
          import matplotlib.image as mpimg
          import numpy as np
          img = mpimg.imread('_static/stinkbug.png')
          imgplot = plt.imshow(img)

  3. Using **doctest** syntax::

       .. plot::
          A plotting example:
          >>> import matplotlib.pyplot as plt
          >>> plt.plot([1,2,3], [4,5,6])

Options
-------

The ``plot`` directive supports the following options:

    format : {'python', 'doctest'}
        Specify the format of the input

    include-source : bool
        Whether to display the source code. The default can be changed
        using the `plot_include_source` variable in conf.py

    encoding : str
        If this source file is in a non-UTF8 or non-ASCII encoding,
        the encoding must be specified using the `:encoding:` option.
        The encoding will not be inferred using the ``-*- coding -*-``
        metacomment.

    context : bool or str
        If provided, the code will be run in the context of all
        previous plot directives for which the `:context:` option was
        specified.  This only applies to inline code plot directives,
        not those run from files. If the ``:context: reset`` option is
        specified, the context is reset for this and future plots, and
        previous figures are closed prior to running the code.
        ``:context:close-figs`` keeps the context but closes previous figures
        before running the code.

    nofigs : bool
        If specified, the code block will be run, but no figures will
        be inserted.  This is usually useful with the ``:context:``
        option.

Additionally, this directive supports all of the options of the
`image` directive, except for `target` (since plot will add its own
target).  These include `alt`, `height`, `width`, `scale`, `align` and
`class`.

Configuration options
---------------------

The plot directive has the following configuration options:

    plot_include_source
        Default value for the include-source option

    plot_html_show_source_link
        Whether to show a link to the source in HTML.

    plot_pre_code
        Code that should be executed before each plot. If not specified or None
        it will default to a string containing::

            import numpy as np
            from matplotlib import pyplot as plt

    plot_basedir
        Base directory, to which ``plot::`` file names are relative
        to.  (If None or empty, file names are relative to the
        directory where the file containing the directive is.)

    plot_formats
        File formats to generate. List of tuples or strings::

            [(suffix, dpi), suffix, ...]

        that determine the file format and the DPI. For entries whose
        DPI was omitted, sensible defaults are chosen. When passing from
        the command line through sphinx_build the list should be passed as
        suffix:dpi,suffix:dpi, ....

    plot_html_show_formats
        Whether to show links to the files in HTML.

    plot_rcparams
        A dictionary containing any non-standard rcParams that should
        be applied before each plot.

    plot_apply_rcparams
        By default, rcParams are applied when `context` option is not used in
        a plot directive.  This configuration option overrides this behavior
        and applies rcParams before each plot.

    plot_working_directory
        By default, the working directory will be changed to the directory of
        the example, so the code can get at its data files, if any.  Also its
        path will be added to `sys.path` so it can import any helper modules
        sitting beside it.  This configuration option can be used to specify
        a central directory (also added to `sys.path`) where data files and
        helper modules for all code are located.

    plot_template
        Provide a customized template for preparing restructured text.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   xrange(   t   relpath(   t
   directives(   t   Imageu   .i   u   [^0-9]t   recordu   erroru   Agg(   t   _pylab_helpersc	   	      C` s   t  | | | | | |  S(   u^   Implementation of the ``.. plot::`` directive.

    See the module docstring for details.
    (   t   run(	   t   namet	   argumentst   optionst   contentt   linenot   content_offsett
   block_textt   statet   state_machine(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   plot_directive   s    c         C` sd   |  s |  j    r t S|  j    j   d k r4 t S|  j    j   d	 k rP t St d |    d  S(
   Nu   nou   0u   falseu   yesu   1u   trueu   "%s" unknown boolean(   u   nou   0u   false(   u   yesu   1u   true(   t   stript   Truet   lowert   Falset
   ValueError(   t   arg(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   _option_boolean   s    c         C` s    |  d k r |  St d   d  S(   Nu   resetu
   close-figsu2   argument should be None or 'reset' or 'close-figs'(   Nu   resetu
   close-figs(   t   NoneR   (   R   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   _option_context   s    c         C` s   t  j |  d  S(   Nu   pythonu   doctest(   u   pythonu   doctest(   R   t   choice(   R   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   _option_format   s    c         C` s   t  j |  d  S(   Nu   topu   middleu   bottomu   leftu   centeru   right(   u   topu   middleu   bottomu   leftu   centeru   right(   R   R   (   R   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   _option_align   s    	c   	      C` s4  x-t  j | j  D]\ } } | s+ q n  | j | } | d k rJ q n  | j | } | j d k r x | D] } | j d k rm | } x- | D]% } | j d k r | j   } Pq q W| d j |  | d j |  | d j	 |  | d j	 |  | j
 j j | | f | j
 j j | <Pqm qm Wq q Wd S(	   u   
    To make plots referenceable, we need to move the reference from
    the "htmlonly" (or "latexonly") node to the actual figure node
    itself.
    u	   html_onlyu
   latex_onlyu   figureu   captionu   idsu   namesN(   u	   html_onlyu
   latex_only(   t   sixt	   iteritemst	   nametypest   nameidsR   t   idst   tagnamet   astextt   removet   appendt   settingst   envt   docnamet   labels(	   t   appt   documentR   t   explicitt   labelidt   nodet   nt   sectnamet   c(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   mark_plot_labels   s*    %c         C` s  |  t  _ |  j t  _ |  j t  _ i t j d 6t j d 6t j d 6t j d 6t	 d 6t j
 d 6t d 6t d 6t d	 6t j d
 6t j d 6} |  j d t t d d t f |  |  j d d  t  |  j d t t  |  j d t t  |  j d d d d g t  |  j d d  t  |  j d t t  |  j d i  t  |  j d t t  |  j d d  t  |  j d d  t  |  j t d  t  i t d 6t d 6} | S(   Nu   altu   heightu   widthu   scaleu   alignu   classu   include-sourceu   formatu   contextu   nofigsu   encodingu   ploti    i   u   plot_pre_codeu   plot_include_sourceu   plot_html_show_source_linku   plot_formatsu   pngu	   hires.pngu   pdfu   plot_basediru   plot_html_show_formatsu   plot_rcparamsu   plot_apply_rcparamsu   plot_working_directoryu   plot_templateu   doctree-readu   parallel_read_safeu   parallel_write_safe(   t   setupR.   t   configt   confdirR   t	   unchangedt   length_or_unitlesst    length_or_percentage_or_unitlesst   nonnegative_intR    t   class_optionR   R   R   t   flagt   encodingt   add_directiveR   R   R   t   add_config_valueR   t   connectt   strR6   (   R.   R   t   metadata(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyR7      s8    	




"c         C` sZ   y t  |  d d  t SWn t k
 r+ n Xt j  d t j  } | j |   } t |  S(   Nu   <string>u   execu   ^\s*>>>(   t   compileR   t   SyntaxErrort   ret   Mt   searcht   bool(   t   textt   rt   m(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   contains_doctest!  s    c         C` s   t  |   s |  Sd } xz |  j d  D]i } t j d |  } | r^ | | j d  d 7} q& | j   r | d | j   d 7} q& | d 7} q& W| S(   u`   
    Extract code from a piece of text, which contains either Python code
    or doctests.

    u    u   
u   ^\s*(>>>|\.\.\.) (.*)$i   u   # (   RO   t   splitRH   t   matcht   groupR   (   RL   t   codet   lineRN   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   unescape_doctest-  s    c         C` s   g  } t  |   } g  } x |  j d  D]p } | rG | j   d k s_ | r | j   d k r | j |  | j d j |   g  } q( | j |  q( Wd j |  j   r | j d j |   n  | S(   u#   
    Split code at plt.show()

    u   
u
   plt.show()u   >>> plt.show()(   RO   RP   R   R)   t   join(   RL   t   partst
   is_doctestt   partRT   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   split_code_at_showB  s    	c         C` s(   t  j d d t  j } | j d |   S(   uC   
    Remove the coding comment, which six.exec\_ doesn't like.
    u   ^#\s*-\*-\s*coding:\s*.*-\*-$t   flagsu    (   RH   RF   t	   MULTILINEt   sub(   RL   t   sub_re(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   remove_codingY  s    u  
{{ source_code }}

{{ only_html }}

   {% if source_link or (html_show_formats and not multi_image) %}
   (
   {%- if source_link -%}
   `Source code <{{ source_link }}>`__
   {%- endif -%}
   {%- if html_show_formats and not multi_image -%}
     {%- for img in images -%}
       {%- for fmt in img.formats -%}
         {%- if source_link or not loop.first -%}, {% endif -%}
         `{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
       {%- endfor -%}
     {%- endfor -%}
   {%- endif -%}
   )
   {% endif %}

   {% for img in images %}
   .. figure:: {{ build_dir }}/{{ img.basename }}.{{ default_fmt }}
      {% for option in options -%}
      {{ option }}
      {% endfor %}

      {% if html_show_formats and multi_image -%}
        (
        {%- for fmt in img.formats -%}
        {%- if not loop.first -%}, {% endif -%}
        `{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
        {%- endfor -%}
        )
      {%- endif -%}

      {{ caption }}
   {% endfor %}

{{ only_latex }}

   {% for img in images %}
   {% if 'pdf' in img.formats -%}
   .. figure:: {{ build_dir }}/{{ img.basename }}.pdf
      {% for option in options -%}
      {{ option }}
      {% endfor %}

      {{ caption }}
   {% endif -%}
   {% endfor %}

{{ only_texinfo }}

   {% for img in images %}
   .. image:: {{ build_dir }}/{{ img.basename }}.png
      {% for option in options -%}
      {{ option }}
      {% endfor %}

   {% endfor %}

uh   
.. htmlonly::

   [`source code <%(linkdir)s/%(basename)s.py>`__]

Exception occurred rendering plot.

t	   ImageFilec           B` s#   e  Z d    Z d   Z d   Z RS(   c         C` s   | |  _  | |  _ g  |  _ d  S(   N(   t   basenamet   dirnamet   formats(   t   selfRa   Rb   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   __init__  s    		c         C` s#   t  j j |  j d |  j | f  S(   Nu   %s.%s(   t   ost   pathRV   Rb   Ra   (   Rd   t   format(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   filename  s    c         C` s#   g  |  j  D] } |  j |  ^ q
 S(   N(   Rc   Ri   (   Rd   t   fmt(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt	   filenames  s    (   t   __name__t
   __module__Re   Ri   Rk   (    (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyR`     s   		c         C` sG   t  j j |  pF t  j j |   oF t  j |  j t  j |   j k  S(   uh   
    Returns True if derivative is out-of-date wrt original,
    both of which are full file paths.
    (   Rf   Rg   t   existst   statt   st_mtime(   t   originalt   derived(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   out_of_date  s    t	   PlotErrorc           B` s   e  Z RS(    (   Rl   Rm   (    (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyRt     s   c         C` s  t  j r t j   } n t j   } t t j  } t j	 j
 d k	 r y t j t j	 j
  WnQ t k
 r } t t |  d   n) t k
 r } t t |  d   n Xt j j d t j	 j
  nM | d k	 rt j j t j j |   } t j |  t j j d |  n  t j } | g t _ t j }	 t  j rRt j   t _ n t j   t _ d   }
 zy t |   }  | d k ri  } n  | st j	 j d k rt  j t  j d d  |  qt  j t  j t j	 j  |  n  |
 | d <d |  k rt  j d	 |  n  t |   }  t  j |  |  | d k	 rSt  j | d
 |  n  Wn+ t t f k
 r} t  t! j"     n XWd t j |  | t _ | t j (|	 t _ X| S(   us   
    Import a Python module from a path, and run the function given by
    name, if function_name is not None.
    u[   
`plot_working_directory` option inSphinx configuration file must be a valid directory pathuV   
`plot_working_directory` option in Sphinx configuration file must be a string or Nonei    c          _` s   d  S(   N(    (   R   t   kwarg(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   _dummy_print  s    u   import numpy as np
u%   from matplotlib import pyplot as plt
u   printu   __main__u   __name__ = '__main__'u   ()N(#   R!   t   PY2Rf   t   getcwdut   getcwdt   listt   sysRg   R7   R8   t   plot_working_directoryR   t   chdirt   OSErrorRD   t	   TypeErrort   insertt   abspathRb   t   argvt   stdoutt   PY3t   iot   StringIOt	   cStringIORU   t   plot_pre_codet   exec_t	   text_typeR_   t	   Exceptiont
   SystemExitRt   t	   tracebackt
   format_exc(   RS   t	   code_patht   nst   function_namet   pwdt   old_sys_patht   errRb   t   old_sys_argvR   Rv   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   run_code  s^    							"
	

c         C` s4   | r t  j d  n  t j   t j j |   d  S(   Nu   all(   t   pltt   closet
   matplotlibt   rc_file_defaultst   rcParamst   update(   t   plot_rcparamsR   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   clear_state  s    
c         C` s>  i d d 6d d 6d d 6} g  } |  j  } t | t j  rN | j d  } n  x | D] } t | t j  r d | k r | j d  \ } } | j t |  t |  f  q6| j | | j | d  f  qU t	 |  t
 t f k r&t |  d k r&| j t | d	  t | d
  f  qU t d |   qU W| S(   NiP   u   pngi   u	   hires.pngu   pdfu   ,u   :i   i    i   u)   invalid image format "%r" in plot_formats(   t   plot_formatst
   isinstanceR!   t   string_typesRP   R)   RD   t   intt   gett   typet   tupleRz   t   lenRt   (   R8   t   default_dpiRc   R   Rj   t   suffixt   dpi(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   get_plot_formats   s    	""**c	         C` s  t  |  }	 t |   }
 t } t | |  } xF |	 D]> \ } } t | | j |   rb t } Pn  | j j |  q4 W| r |  | g f g Sg  } t } x
t	 |
  D] \ } } g  } x t
 d  D] } t |
  d k r t d | | | f |  } n t d | | f |  } xF |	 D]> \ } } t | | j |   rIt } Pn  | j j |  qW| ss| d k } Pn  | j |  q W| sPn  | j | | f  q W| r| Sg  } | rt } n i  } | rt | j  t j   n  | p| } xt	 |
  D]\ } } | s | j r3t | j |  n | rIt j d  n  t | | | |  g  } t j j   } xt	 |  D]\ } } t |  d k rt |
  d k rt | |  } nJ t |
  d k rt d | | f |  } n t d | | | f |  } | j |  xr |	 D]j \ } } y& | j j j | j |  d | Wn% t k
 rw} t t j     n X| j j |  qWq~W| j | | f  qW| s| j rt | j d | n  | S(	   u   
    Run a pyplot script and save the images in *output_dir*.

    Save the images under *output_dir* with file names derived from
    *output_base*
    i  i   u   %s_%02d_%02du   %s_%02di    u   allR   R   (   R   RZ   R   R`   Rs   Ri   R   Rc   R)   t	   enumerateR   R   t   plot_contextR   R   t   cleart   plot_apply_rcparamsR   R   R   R	   t   Gcft   get_all_fig_managerst   canvast   figuret   savefigR   Rt   R   R   (   RS   R   t
   output_dirt   output_baset   contextR   R8   t   context_resett
   close_figsRc   t   code_piecest
   all_existst   imgRh   R   t   resultst   it
   code_piecet   imagest   jR   t   fig_managerst   figmanR   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   render_figures7  s    		$	&c   ;      C` s  | j  } | j j j } d | k } t |  }	 |	 d d }
 | j d | j  d | k } | si d  n | d } | j d } t	 j
 j |  } t |   rv| j s t	 j
 j t j j j t j |  d   } n+ t	 j
 j t j | j t j |  d   } d j |  } t |   d k r.|  d } n d  } t j | d	 d
 d  } | j   } Wd  QXt	 j
 j |  } n | } t j d j t t j |    } | j j d d  d } | | j d <t	 j
 j  t	 j
 j |   \ } } d | | f } d  } d } t	 j
 j  |  \ } } | d: k r3| } n d } | j! d d  } t" |  } d | k r| d d k r|t# } qt$ } n  t% | t j  } t	 j
 j |  } x# | j& t	 j
 j'  r| d } qWt	 j
 j t	 j
 j t j j(  d |  } t	 j
 j) |  } t	 j
 j* |  s-t	 j+ |  n  t	 j
 j, t	 j
 j t j j j- |   } t	 j
 j* |  syt	 j+ |  n  t	 j
 j t% t j |  |  j! t	 j
 j' d  } y% t% | |  j! t	 j
 j' d  } Wn t. k
 r| } n X| d | | }  y@ t/ | | | | | | | d | d k d | d k }! g  }" Wn^ t0 k
 r}# | j1 j2 }$ |$ j3 d d j4 | | |#  d | }% | g  f g }! |% g }" n Xd j d   | j5 d  D  } g  }& xt6 |!  D]\ }' \ }( }) | d r{| r-d g }* |* g  |( j5 d  D] }+ |+ j7   ^ q7}* n< d d g }* |* g  |( j5 d  D] }+ d  |+ j7   ^ qL7}* d j |*  }, n d }, | rg  }) n  g  t j8 |  D]( \ }- }. |- d; k rd' |- |. f ^ q}/ d( }0 d) }1 d* }2 |' d k r| j9 r|  }3 n d  }3 t: j; | j< pt=  j> d+ |
 d, | d- | d. |3 d/ t |)  d k d0 |0 d1 |1 d2 |2 d3 |/ d4 |) d5 |, d6 | j? ot |)  d7 |  }4 |& j@ |4 j5 d   |& j@ d  qW|& r| jA |& d8 | n  t	 j
 j* |  stB jC |  n  x| |! D]t \ }( }) xe |) D]] }5 xT |5 jD   D]F }6 t	 j
 j | t	 j
 j |6   }7 |6 |7 k rtE jF |6 |7  qqWq
WqWt	 j
 j | | |  }8 t j |8 d9 d
 d 5 }9 | | k rtG |  }: n | }: |9 jH |:  Wd  QX|" S(<   Nu   nofigsi    u   include-sourceu   contextu   sourceu   
i   i   u   rR@   u   utf-8u   _plot_counteru   %s-%d.pyu    u   .pyu   .rstu   .txtu   .u   -u   formatu   pythonu   plot_directiveu   /R   u   resetR   u
   close-figsu.   Exception occurred in plotting {}
 from {}:
{}RT   c         s` s   |  ] } d  | j    Vq d S(   u         N(   R   (   t   .0RT   (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pys	   <genexpr>  s   u   .. code-block:: pythonu       %su   altu   heightu   widthu   scaleu   alignu   classu   :%s: %su   .. only:: htmlu   .. only:: latexu   .. only:: texinfot   default_fmtt   dest_dirt	   build_dirt   source_linkt   multi_imaget	   only_htmlt
   only_latext   only_texinfoR   R   t   source_codet   html_show_formatst   captiont   sourceu   w(   u   .pyu   .rstu   .txt(   u   altu   heightu   widthu   scaleu   alignu   class(I   R/   R*   R+   R8   R   t
   setdefaultt   plot_include_sourceR   t
   attributesRf   Rg   Rb   R   t   plot_basedirRV   R7   R.   t   buildert   srcdirR   t   uriR9   R   t   opent   readRa   t   textwrapt   dedentt   mapR!   R   R   t   splitextt   replaceRO   R   R   R   t
   startswitht   sept
   doctreedirt   normpathRn   t   makedirsR   t   outdirR   R   Rt   t   memot   reportert   system_messageRh   RP   R   t   rstripR"   t   plot_html_show_source_linkt   jinja2t   Templatet   plot_templatet   TEMPLATEt   rendert   plot_html_show_formatst   extendt   insert_inputt   cbookt   mkdirsRk   t   shutilt   copyfileRU   t   write(;   R   R   R   R   R   R   R/   R8   t   nofigsRc   R   t   keep_contextt   context_optt   rst_filet   rst_dirt   source_file_nameR   R   t   fdRS   R   t   countert   baset   extt
   source_extRX   t   source_rel_namet   source_rel_dirR   R   t   dest_dir_linkt   build_dir_linkR   R   t   errorsR   R   t   smt   total_linesR   R   R   t   linest   rowR   t   keyt   valt   optsR   R   R   t   src_linkt   resultR   t   fnt   destimgt   target_namet   ft   code_escaped(    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyR
     s   		$$				%

		
	/*	"		!(J   t   __doc__t
   __future__R    R   R   R   R!   t	   six.movesR   R{   Rf   R   R   RH   R   t   os.pathR   R   t   warningsR   R   t   docutils.parsers.rstR   t&   docutils.parsers.rst.directives.imagesR   t   alignt   sphinxt   __version__RP   t   sphinx_versionR   t   xR   R   R   t   matplotlib.cbookR   t   catch_warningsR   t   simplefiltert   UserWarningt   uset   matplotlib.pyplott   pyplotR   t   switch_backendR	   R   R   R   R   R    R6   R7   RO   RU   RZ   R_   R   t   exception_templatet   dictR   t   objectR`   Rs   t   RuntimeErrorRt   R   R   R   R   R   R   R
   (    (    (    sB   lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.pyt   <module>   sh   "H		3								'				J			
L	g