ó
±éRc           @  s  d  Z  d d l m Z d d l Z d d l m Z d d l Z d d l m	 Z	 d d l m
 Z
 d d l m Z d d l j Z d d l m Z m Z d d l j Z d d	 l m Z m Z d d
 l m Z d d l m Z d d l j Z d d l m Z m Z m Z d d l  m! Z! m" Z" d d l# m$ Z$ d d l% m& Z& d d l' m( Z( m) Z) d d l* m+ Z+ m, Z, d d l- m. Z. m/ Z/ m0 Z0 m1 Z1 d d l2 m3 Z3 e
 j4 j5 d e( ƒ  ƒ d e f d „  ƒ  YZ6 d f  d „  ƒ  YZ7 d e f d „  ƒ  YZ8 d „  Z9 e
 j4 j5 d e j: e8 ƒ ƒ d S(   s4  
The figure module provides the top-level
:class:`~matplotlib.artist.Artist`, the :class:`Figure`, which
contains all the plot elements.  The following classes are defined

:class:`SubplotParams`
    control the default spacing of the subplots

:class:`Figure`
    top level container for all plot elements

iÿÿÿÿ(   t   print_functionN(   t
   itemgetter(   t   rcParams(   t	   docstring(   t   __version__(   t   Artistt   allow_rasterization(   t   Stackt   iterable(   t   _image(   t   FigureImage(   t   Axest   SubplotBaset   subplot_class_factory(   t   BlockingMouseInputt   BlockingKeyMouseInput(   t   Legend(   t	   Rectangle(   t   get_projection_namest   process_projection_requirements(   t   Textt   _process_text_args(   t   Affine2Dt   Bboxt   BboxTransformTot   TransformedBbox(   t   NonGuiExceptiont   projection_namest	   AxesStackc           B  sh   e  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  
    Specialization of the Stack to handle all tracking of Axes in a Figure.
    This stack stores ``key, (ind, axes)`` pairs, where:

        * **key** should be a hash of the args and kwargs
          used in generating the Axes.
        * **ind** is a serial number for tracking the order
          in which axes were added.

    The AxesStack is a callable, where ``ax_stack()`` returns
    the current axes. Alternatively the :meth:`current_key_axes` will
    return the current key and associated axes.

    c         C  s   t  j |  ƒ d |  _ d  S(   Ni    (   R   t   __init__t   _ind(   t   self(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR   A   s    c         C  sI   g  |  j  D] \ } } | ^ q
 } | j ƒ  g  | D] \ } } | ^ q3 S(   sX   
        Return a list of the Axes instances that have been added to the figure
        (   t	   _elementst   sort(   R   t   kt   at   ia_listt   i(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   as_listE   s    "
c         C  s0   t  |  j ƒ j | ƒ } | d k r( d S| d S(   sp   
        Return the Axes instance that was added with *key*.
        If it is not present, return None.
        i   N(   t   dictR    t   gett   None(   R   t   keyt   item(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR(   M   s    c         C  sT   t  g  |  j D]$ \ } \ } } | | | f f ^ q ƒ | \ } } | | | f f S(   N(   R'   R    (   R   t   eR"   t   indR#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   _entry_from_axesW   s    Dc         C  s   t  j |  |  j | ƒ ƒ d S(   s   Remove the axes from the stack.N(   R   t   removeR.   (   R   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR/   [   s    c         C  s   t  j |  |  j | ƒ ƒ S(   sa   
        Move the given axes, which must already exist in the
        stack, to the top.
        (   R   t   bubbleR.   (   R   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR0   _   s    c         C  s×   t  | t ƒ s" t d | ƒ ‚ n  y t | ƒ Wn! t k
 rS t d | ƒ ‚ n X|  j | ƒ } | d k	 r™ t j |  | | f ƒ t	 j
 d | ƒ n  | |  k r© d S|  j d 7_ t j |  | |  j | f f ƒ S(   s«   
        Add Axes *a*, with key *key*, to the stack, and return the stack.

        If *a* is already on the stack, don't add it again, but
        return *None*.
        s#   second argument, %s, is not an Axess&   first argument, %s, is not a valid keys.   key %s already existed; Axes is being replacedi   N(   t
   isinstanceR   t
   ValueErrort   hasht	   TypeErrorR(   R)   R   R/   t   warningst   warnR   t   push(   R   R*   R#   t
   a_existing(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   addf   s    	c         C  sI   t  |  j ƒ s |  j |  j f S|  j |  j \ } \ } } | | f Sd S(   s‘   
        Return a tuple of ``(key, axes)`` for the active axes.

        If no axes exists on the stack, then returns ``(None, None)``.

        N(   t   lenR    t   _defaultt   _pos(   R   R*   t   indext   axes(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   current_key_axes‚   s    c         C  s   |  j  ƒ  d S(   Ni   (   R?   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   __call__�   s    c         C  s   | |  j  ƒ  k S(   N(   R&   (   R   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   __contains__’   s    (   t   __name__t
   __module__t   __doc__R   R&   R(   R.   R/   R0   R9   R?   R@   RA   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR   2   s   			
						t   SubplotParamsc           B  sM   e  Z d  Z d d d d d d d „ Z d d d d d d d „ Z d „  Z RS(   s6   
    A class to hold the parameters for a subplot
    c         C  s)   t  |  _ |  j | | | | | | ƒ d S(   s¤  
        All dimensions are fraction of the figure width or height.
        All values default to their rc params

        The following attributes are available

        *left*  : 0.125
            The left side of the subplots of the figure

        *right* : 0.9
            The right side of the subplots of the figure

        *bottom* : 0.1
            The bottom of the subplots of the figure

        *top* : 0.9
            The top of the subplots of the figure

        *wspace* : 0.2
            The amount of width reserved for blank space between subplots

        *hspace* : 0.2
            The amount of height reserved for white space between subplots
        N(   t   Truet   validatet   update(   R   t   leftt   bottomt   rightt   topt   wspacet   hspace(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR   š   s    	c           sM  t  ˆ  d d
 ƒ ‰ t  ˆ  d d
 ƒ ‰ t  ˆ  d d
 ƒ ‰ t  ˆ  d d
 ƒ ‰ t  ˆ  d d
 ƒ ‰ t  ˆ  d d
 ƒ ‰ ˆ  j d | ƒ ˆ  j d | ƒ ˆ  j d | ƒ ˆ  j d | ƒ ˆ  j d | ƒ ˆ  j d | ƒ ‡  ‡ ‡ ‡ ‡ ‡ ‡ f d †  } ˆ  j rIˆ  j ˆ  j k r| ƒ  t d ƒ ‚ n  ˆ  j ˆ  j k rI| ƒ  t d	 ƒ ‚ qIn  d
 S(   s‚   
        Update the current values.  If any kwarg is None, default to
        the current value, if set, otherwise to rc

        RI   RK   RL   RJ   RM   RN   c             s:   ˆ ˆ  _  ˆ ˆ  _ ˆ ˆ  _ ˆ ˆ  _ ˆ ˆ  _ ˆ ˆ  _ d  S(   N(   RI   RK   RL   RJ   RM   RN   (    (   R   t
   thisbottomt
   thishspacet   thisleftt	   thisrightt   thistopt
   thiswspace(    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   resetÎ   s    					s   left cannot be >= rights   bottom cannot be >= topN(	   t   getattrR)   t   _update_thisRG   RI   RK   R2   RJ   RL   (   R   RI   RJ   RK   RL   RM   RN   RU   (    (   R   RO   RP   RQ   RR   RS   RT   sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRH   ¸   s(    !	c         C  sX   | d  k rD t |  | d  ƒ } | d  k rD d | } t | } qD n  t |  | | ƒ d  S(   Ns   figure.subplot.(   R)   RV   R   t   setattr(   R   t   st   valR*   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRW   ß   s    
N(   RB   RC   RD   R)   R   RH   RW   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRE   –   s   &t   Figurec        	   B  sÌ  e  Z d  Z d „  Z dF dF dF dF d dF dF dF d „ Z e d „ Z d „  Z e	 d e d d ƒ Z
 d	 „  Z d
 „  Z e	 e e ƒ Z d „  Z d „  Z d d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z dF d „ Z d d dF dF dF dF dF dF 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% d' „  Z& d( „  Z' e( j) d) „  ƒ Z* e( j) d* „  ƒ Z+ e, d+ „ Z- d, „  Z. e/ d- „  ƒ Z0 d. „  Z1 d/ „  Z2 d0 „  Z3 e( j) d1 „  ƒ Z4 d2 „  Z5 e( j) d3 „  ƒ Z6 d4 „  Z7 d5 „  Z8 d6 „  Z9 d7 „  Z: d8 „  Z; d9 „  Z< e( j) dF dF e d: „ ƒ Z= d; „  Z> d< d e d< d= d> d? „ Z? d@ dA „ Z@ dB „  ZA dC „  ZB dF dD dF dF dF dE „ ZC RS(G   s“  
    The Figure instance supports callbacks through a *callbacks*
    attribute which is a :class:`matplotlib.cbook.CallbackRegistry`
    instance.  The events you can connect to are 'dpi_changed', and
    the callback will be called with ``func(fig)`` where fig is the
    :class:`Figure` instance.

    *patch*
       The figure patch is drawn by a
       :class:`matplotlib.patches.Rectangle` instance

    *suppressComposite*
       For multiple figure images, the figure will make composite
       images depending on the renderer option_image_nocomposite
       function.  If suppressComposite is True|False, this will
       override the renderer.
    c         C  s   d t  |  j j ƒ S(   Ns   Figure(%gx%g)(   t   tuplet   bboxt   size(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   __str__ý   s    g        c	   	      C  sÀ  t  j |  ƒ t j ƒ  |  _ | d k r5 t d } n  | d k rN t d } n  | d k rg t d } n  | d k r€ t d } n  | d k r™ t d } n  t ƒ  |  _ | |  _	 t
 j d d | Œ |  _ t |  j |  j ƒ |  _ | |  _ t |  j ƒ |  _ t d d d d	 d
 d	 d | d | d | ƒ |  _ |  _ |  j |  j ƒ |  j j t ƒ t d |  _ d |  _ d |  _ | d k r‡t ƒ  } n  | |  _ |  j | ƒ t ƒ  |  _ |  j  ƒ  d |  _! d S(   s³  
        *figsize*
            w,h tuple in inches

        *dpi*
            Dots per inch

        *facecolor*
            The figure patch facecolor; defaults to rc ``figure.facecolor``

        *edgecolor*
            The figure patch edge color; defaults to rc ``figure.edgecolor``

        *linewidth*
            The figure patch edge linewidth; the default linewidth of the frame

        *frameon*
            If *False*, suppress drawing the figure frame

        *subplotpars*
            A :class:`SubplotParams` instance, defaults to rc

        *tight_layout*
            If *False* use *subplotpars*; if *True* adjust subplot
            parameters using :meth:`tight_layout` with default padding.
            When providing a dict containing the keys `pad`, `w_pad`, `h_pad`
            and `rect`, the default :meth:`tight_layout` paddings will be
            overridden.
            Defaults to rc ``figure.autolayout``.
        s   figure.figsizes
   figure.dpis   figure.facecolors   figure.edgecolors   figure.frameoni    t   xyt   widthi   t   heightt	   facecolort	   edgecolort	   linewidths	   axes.holdN(   i    i    ("   R   R   t   cbookt   CallbackRegistryt	   callbacksR)   R   R   t   dpi_scale_transt   dpiR   t   from_boundst   bbox_inchesR   R]   t   frameonR   t   transFigureR   t   patcht   figurePatcht   _set_artist_propst   set_aat   Falset   _holdt   canvast	   _suptitleRE   t   subplotparst   set_tight_layoutR   t   _axstackt   clft   _cachedRenderer(	   R   t   figsizeRj   Rc   Rd   Re   Rm   Rw   t   tight_layout(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR      sD    (					
c         C  s—   y t  |  j d ƒ } Wn# t k
 r; } t d | ƒ ‚ n X| d k	 rq y | j ƒ  d SWqq t k
 rm qq Xn  | r“ d d l } | j d ƒ n  d S(   s�  
        If using a GUI backend with pyplot, display the figure window.

        If the figure was not created using
        :func:`~matplotlib.pyplot.figure`, it will lack a
        :class:`~matplotlib.backend_bases.FigureManagerBase`, and
        will raise an AttributeError.

        For non-GUI backends, this does nothing, in which case
        a warning will be issued if *warn* is True (default).
        t   managers]   %s
Figure.show works only for figures managed by pyplot, normally created by pyplot.figure().NiÿÿÿÿsJ   matplotlib is currently using a non-GUI backend, so cannot show the figure(   RV   Ru   t   AttributeErrorR)   t   showR   R5   R6   (   R   R6   R~   t   errR5   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR€   V  s    
c         C  s   |  j  j ƒ  S(   N(   Ry   R&   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt	   _get_axesv  s    t   fgett   docs!   Read-only: list of axes in Figurec         C  s   |  j  S(   N(   t   _dpi(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   _get_dpi{  s    c         C  s9   | |  _  |  j j ƒ  j | | ƒ |  j j d |  ƒ d  S(   Nt   dpi_changed(   R…   Ri   t   cleart   scaleRh   t   process(   R   Rj   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   _set_dpi~  s    	c         C  s   |  j  S(   sX   
        Return the Boolean flag, True to use :meth`tight_layout` when drawing.
        (   t   _tight(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_tight_layout„  s    c         C  sJ   | d k r t d } n  t | ƒ |  _ t | t ƒ r= | n i  |  _ d S(   sc  
        Set whether :meth:`tight_layout` is used upon drawing.
        If None, the rcParams['figure.autolayout'] value will be set.

        When providing a dict containing the keys `pad`, `w_pad`, `h_pad`
        and `rect`, the default :meth:`tight_layout` paddings will be
        overridden.

        ACCEPTS: [True | False | dict | None ]
        s   figure.autolayoutN(   R)   R   t   boolRŒ   R1   R'   t   _tight_parameters(   R   t   tight(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRx   Š  s    gš™™™™™É?i   RK   c         C  s,  t  j g  |  j D] } t | d ƒ ^ q ƒ } t |  j ƒ d k r~ xÉ |  j d j ƒ  D]  } | j | ƒ | j | ƒ qW Wn‘ | rxˆ |  j ƒ  D]w } | j	 ƒ  r× xb | j ƒ  D]  } | j | ƒ | j | ƒ q° Wq‘ x! | j ƒ  D] } | j
 t ƒ qä W| j d ƒ q‘ Wn  | r(|  j d | ƒ n  d S(   s_  
        Date ticklabels often overlap, so it is useful to rotate them
        and right align them.  Also, a common use case is a number of
        subplots with shared xaxes where the x-axis is date data.  The
        ticklabels are often long, and it helps to rotate them on the
        bottom subplot and turn them off on other subplots, as well as
        turn off xlabels.

        *bottom*
            The bottom of the subplots for :meth:`subplots_adjust`

        *rotation*
            The rotation of the xtick labels

        *ha*
            The horizontal alignment of the xticklabels
        t   is_last_rowi   i    t    RJ   N(   t   npt   alltrueR>   t   hasattrR:   t   get_xticklabelst   set_hat   set_rotationt   get_axesR‘   t   set_visibleRs   t
   set_xlabelt   subplots_adjust(   R   RJ   t   rotationt   hat   axt   allsubplotst   label(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   autofmt_xdateš  s"    	%c         C  s€   |  j  g } | j |  j ƒ | j |  j ƒ | j |  j ƒ | j |  j ƒ | j |  j ƒ | j |  j ƒ | j |  j ƒ | S(   s-   get a list of artists contained in the figure(	   Ro   t   extendt   artistsR>   t   linest   patchest   textst   imagest   legends(   R   t   children(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_childrenÁ  s    c         C  sD   t  |  j ƒ r |  j |  | ƒ S|  j j | j | j ƒ } | i  f S(   s_   
        Test whether the mouse event occurred on the figure.

        Returns True,{}
        (   t   callablet	   _containsR]   t   containst   xt   y(   R   t
   mouseeventt   inside(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR®   Í  s    c         O  s   |  j  S(   s=   get the figure bounding box in display space; kwargs are void(   R]   (   R   t   argst   kwargs(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_window_extentÚ  s    c         K  sÞ   | j  d d ƒ } | j  d d ƒ } d | k rI d | k rI d | d <n  d | k rn d	 | k rn d
 | d <n  |  j | | | | � } |  j d k	 rÎ |  j j | ƒ |  j j | | f ƒ |  j j | ƒ n	 | |  _ |  j S(   s‰  
        Add a centered title to the figure.

        kwargs are :class:`matplotlib.text.Text` properties.  Using figure
        coordinates, the defaults are:

          *x* : 0.5
            The x location of the text in figure coords

          *y* : 0.98
            The y location of the text in figure coords

          *horizontalalignment* : 'center'
            The horizontal alignment of the text

          *verticalalignment* : 'top'
            The vertical alignment of the text

        A :class:`matplotlib.text.Text` instance is returned.

        Example::

          fig.suptitle('this is the figure title', fontsize=12)
        R¯   g      à?R°   g\�Âõ(\ï?t   horizontalalignmentRž   t   centert   verticalalignmentt   vaRL   N(   t   popt   textRv   R)   t   set_textt   set_positiont   update_from(   R   t   tR´   R¯   R°   t   sup(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   suptitleÞ  s    	c         C  s   | |  _  d S(   sb   
        Set the canvas the contains the figure

        ACCEPTS: a FigureCanvas instance
        N(   Ru   (   R   Ru   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt
   set_canvas  s    c         C  s)   | d k r |  j |  _ n	 | |  _ d S(   s  
        Set the hold state.  If hold is None (default), toggle the
        hold state.  Else set the hold state to boolean value b.

        e.g.::

            hold()      # toggle hold
            hold(True)  # hold is on
            hold(False) # hold is off
        N(   R)   Rt   (   R   t   b(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   hold  s    i    c
         K  s�   |  j  s |  j ƒ  n  t |  | | | | |	 |
 � } | j | ƒ | j | ƒ | d k rm | j | | ƒ n  |  j j | ƒ | S(   sÖ  
        Adds a non-resampled image to the figure.

        call signatures::

          figimage(X, **kwargs)

        adds a non-resampled array *X* to the figure.

        ::

          figimage(X, xo, yo)

        with pixel offsets *xo*, *yo*,

        *X* must be a float array:

        * If *X* is MxN, assume luminance (grayscale)
        * If *X* is MxNx3, assume RGB
        * If *X* is MxNx4, assume RGBA

        Optional keyword arguments:

          =========   =========================================================
          Keyword     Description
          =========   =========================================================
          xo or yo    An integer, the *x* and *y* image offset in pixels
          cmap        a :class:`matplotlib.colors.Colormap` instance, eg
                      cm.jet. If *None*, default to the rc ``image.cmap``
                      value
          norm        a :class:`matplotlib.colors.Normalize` instance. The
                      default is normalization().  This scales luminance -> 0-1
          vmin|vmax   are used to scale a luminance image to 0-1.  If either
                      is *None*, the min and max of the luminance values will
                      be used.  Note if you pass a norm instance, the settings
                      for *vmin* and *vmax* will be ignored.
          alpha       the alpha blending value, default is *None*
          origin      [ 'upper' | 'lower' ] Indicates where the [0,0] index of
                      the array is in the upper left or lower left corner of
                      the axes. Defaults to the rc image.origin value
          =========   =========================================================

        figimage complements the axes image
        (:meth:`~matplotlib.axes.Axes.imshow`) which will be resampled
        to fit the current axes.  If you want a resampled image to
        fill the entire figure, you can define an
        :class:`~matplotlib.axes.Axes` with size [0,1,0,1].

        An :class:`matplotlib.image.FigureImage` instance is returned.

        .. plot:: mpl_examples/pylab_examples/figimage_demo.py


        Additional kwargs are Artist kwargs passed on to
        :class:`~matplotlib.image.FigureImage`
        N(	   Rt   Rz   R
   t	   set_arrayt	   set_alphaR)   t   set_climR¨   t   append(   R   t   Xt   xot   yot   alphat   normt   cmapt   vmint   vmaxt   originR´   t   im(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   figimage   s    C	c   
      O  sÈ   | j  d t ƒ } t | ƒ d k r7 | d \ } } n | \ } } |  j } | | f |  j _ | rÄ |  j } | | } | | } t |  j d d ƒ }	 |	 d k	 rÄ |	 j	 t
 | ƒ t
 | ƒ ƒ qÄ n  d S(   s–  
        set_size_inches(w,h, forward=False)

        Set the figure size in inches

        Usage::

             fig.set_size_inches(w,h)  # OR
             fig.set_size_inches((w,h) )

        optional kwarg *forward=True* will cause the canvas size to be
        automatically updated; eg you can resize the figure window
        from the shell

        ACCEPTS: a w,h tuple with w,h in inches
        t   forwardi   i    R~   N(   R(   Rs   R:   Rj   Rl   t   p1RV   Ru   R)   t   resizet   int(
   R   R³   R´   RÔ   t   wt   ht   dpivalt   canvaswt   canvashR~   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   set_size_inchesn  s    		

c         C  s
   |  j  j S(   N(   Rl   RÕ   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_size_inches‘  s    c         C  s   |  j  j ƒ  S(   s*   Get the edge color of the Figure rectangle(   Ro   t   get_edgecolor(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRß   ”  s    c         C  s   |  j  j ƒ  S(   s*   Get the face color of the Figure rectangle(   Ro   t   get_facecolor(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRà   ˜  s    c         C  s
   |  j  j S(   s   Return the figwidth as a float(   Rl   Ra   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_figwidthœ  s    c         C  s
   |  j  j S(   s   Return the figheight as a float(   Rl   Rb   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_figheight   s    c         C  s   |  j  S(   s   Return the dpi as a float(   Rj   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_dpi¤  s    c         C  s   |  j  S(   s"   get the boolean indicating frameon(   Rm   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   get_frameon¨  s    c         C  s   |  j  j | ƒ d S(   sv   
        Set the edge color of the Figure rectangle

        ACCEPTS: any matplotlib color - see help(colors)
        N(   Ro   t   set_edgecolor(   R   t   color(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRå   ¬  s    c         C  s   |  j  j | ƒ d S(   sv   
        Set the face color of the Figure rectangle

        ACCEPTS: any matplotlib color - see help(colors)
        N(   Ro   t   set_facecolor(   R   Ræ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRç   ´  s    c         C  s   | |  _  d S(   sM   
        Set the dots-per-inch of the figure

        ACCEPTS: float
        N(   Rj   (   R   RZ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   set_dpi¼  s    c         C  s   | |  j  _ d S(   sO   
        Set the width of the figure in inches

        ACCEPTS: float
        N(   Rl   t   x1(   R   RZ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   set_figwidthÄ  s    c         C  s   | |  j  _ d S(   sP   
        Set the height of the figure in inches

        ACCEPTS: float
        N(   Rl   t   y1(   R   RZ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   set_figheightÌ  s    c         C  s   | |  _  d S(   so   
        Set whether the figure frame (background) is displayed or invisible

        ACCEPTS: boolean
        N(   Rm   (   R   RÃ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   set_frameonÔ  s    c         C  s2   |  j  j | ƒ x |  j D] } | |  ƒ q Wd S(   s4   remove a from the figure and update the current axesN(   Ry   R/   t   _axobservers(   R   R#   t   func(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   delaxesÜ  s    c         O  s4   d „  } d „  } | | ƒ | | j  ƒ  ƒ f } | S(   s*   make a hashable key out of args and kwargsc         S  sU   g  } xB |  D]: \ } } t  | ƒ r4 t | ƒ } n  | j | | f ƒ q Wt | ƒ S(   N(   R   R\   RÈ   (   t   itemst   retR"   t   v(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   fixitemså  s    c         S  sI   g  } x6 |  D]. } t  | ƒ r. t | ƒ } n  | j | ƒ q Wt | ƒ S(   N(   R   R\   RÈ   (   R³   Rò   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   fixlistï  s    (   t	   iteritems(   R   R³   R´   Rô   Rõ   R*   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt	   _make_keyâ  s    	
	c         O  s"  t  | ƒ s d S|  j | | Ž  } |  j j | ƒ } | d k	 rQ |  j | ƒ | St | d t ƒ r‰ | d } | j ƒ  |  k sþ t	 ‚ nu | d } t
 |  | | Ž \ } } } |  j j | ƒ } | d k	 rì t | | ƒ rì |  j | ƒ | S| |  | | � } |  j j | | ƒ |  j | ƒ | S(   sÒ  
        Add an axes at position *rect* [*left*, *bottom*, *width*,
        *height*] where all quantities are in fractions of figure
        width and height.  kwargs are legal
        :class:`~matplotlib.axes.Axes` kwargs plus *projection* which
        sets the projection type of the axes.  (For backward
        compatibility, ``polar=True`` may also be provided, which is
        equivalent to ``projection='polar'``).  Valid values for
        *projection* are: %(projection_names)s.  Some of these
        projections support  additional kwargs, which may be provided
        to :meth:`add_axes`. Typical usage::

            rect = l,b,w,h
            fig.add_axes(rect)
            fig.add_axes(rect, frameon=False, axisbg='g')
            fig.add_axes(rect, polar=True)
            fig.add_axes(rect, projection='polar')
            fig.add_axes(ax)

        If the figure already has an axes with the same parameters,
        then it will simply make that axes current and return it.  If
        you do not want this behavior, e.g., you want to force the
        creation of a new Axes, you must use a unique set of args and
        kwargs.  The axes :attr:`~matplotlib.axes.Axes.label`
        attribute has been exposed for this purpose.  e.g., if you want
        two axes that are otherwise identical to be added to the
        figure, make sure you give them unique labels::

            fig.add_axes(rect, label='axes1')
            fig.add_axes(rect, label='axes2')

        In rare circumstances, add_axes may be called with a single
        argument, an Axes instance already created in the present
        figure but not in the figure's list of axes.  For example,
        if an axes has been removed with :meth:`delaxes`, it can
        be restored with::

            fig.add_axes(ax)

        In all cases, the :class:`~matplotlib.axes.Axes` instance
        will be returned.

        In addition to *projection*, the following kwargs are supported:

        %(Axes)s
        Ni    (   R:   R÷   Ry   R(   R)   t   scaR1   R   t
   get_figuret   AssertionErrorR   R9   (   R   R³   R´   R*   RŸ   R#   t   rectt   projection_class(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   add_axesú  s*    0

c         O  sY  t  | ƒ s d St  | ƒ d k rg t | d t ƒ rg t g  t | d ƒ D] } t | ƒ ^ qI ƒ } n  t | d t ƒ r± | d } | j ƒ  |  k sœ t ‚ |  j | | Ž  } n„ t	 |  | | Ž \ } } } |  j
 j | ƒ } | d k	 rt | | ƒ r
|  j | ƒ | S|  j
 j | ƒ n  t | ƒ |  | | Ž } |  j
 j | | ƒ |  j | ƒ | S(   sz  
        Add a subplot.  Examples::

            fig.add_subplot(111)

            # equivalent but more general
            fig.add_subplot(1,1,1)

            # add subplot with red background
            fig.add_subplot(212, axisbg='r')

            # add a polar subplot
            fig.add_subplot(111, projection='polar')

            # add Subplot instance sub
            fig.add_subplot(sub)

        *kwargs* are legal :class:`~matplotlib.axes.Axes` kwargs plus
        *projection*, which chooses a projection type for the axes.
        (For backward compatibility, *polar=True* may also be
        provided, which is equivalent to *projection='polar'*). Valid
        values for *projection* are: %(projection_names)s.  Some of
        these projections
        support additional *kwargs*, which may be provided to
        :meth:`add_axes`.

        The :class:`~matplotlib.axes.Axes` instance will be returned.

        If the figure already has a subplot with key (*args*,
        *kwargs*) then it will simply make that subplot current and
        return it.

        The following kwargs are supported:

        %(Axes)s
        Ni   i    (   R:   R1   R×   R\   t   strR   Rù   Rú   R÷   R   Ry   R(   R)   Rø   R/   R   R9   (   R   R³   R´   t   cR#   R*   Rü   RŸ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   add_subplotK  s(    &%2
c         C  sÐ   d |  _ t j ƒ  |  _ x. t |  j ƒ D] } | j ƒ  |  j | ƒ q( Wt	 |  j
 d d ƒ } | d k	 rw | j ƒ  n  |  j j ƒ  g  |  _ g  |  _ g  |  _ g  |  _ g  |  _ g  |  _ | sÌ g  |  _ n  d S(   s“   
        Clear the figure.

        Set *keep_observers* to True if, for example,
        a gui widget is tracking the axes in the figure.
        t   toolbarN(   R)   t   suppressCompositeRf   Rg   Rh   R\   R>   t   claRð   RV   Ru   RH   Ry   Rˆ   R¤   R¥   R¦   R§   R¨   R©   Rî   (   R   t   keep_observersRŸ   R  (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRz   ˜  s"    	
						c         C  s   |  j  ƒ  d S(   s>   
        Clear the figure -- synonym for :meth:`clf`.
        N(   Rz   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRˆ   ³  s    c           sê  ˆ j  ƒ  s d Sˆ j d ƒ ˆ j ƒ  r` ˆ j r` y ˆ j ˆ ˆ j � Wq` t k
 r\ q` Xn  ˆ j r| ˆ j j	 ˆ ƒ n  g  } x6 ˆ j
 D]+ } | j | j ƒ  | | j	 ˆ g f ƒ qŒ Wx6 ˆ j D]+ } | j | j ƒ  | | j	 ˆ g f ƒ qÅ Wx6 ˆ j D]+ } | j | j ƒ  | | j	 ˆ g f ƒ qþ Wˆ j ƒ  } ˆ j d k	 rTˆ j } n  t ˆ j ƒ d k s˜| s˜t j g  ˆ j D] ‰ ˆ j ^ qƒ rÔxˆ j D]+ } | j | j ƒ  | | j	 ˆ g f ƒ q¢WnÛ ˆ j ƒ  } g  ˆ j D]- ‰ ˆ j | ƒ ˆ j ˆ j ˆ j ƒ  f ^ qê} t j ˆ j j | ˆ j j  | | ƒ ‰ t! ˆ _" ˆ j j# \ ‰ ‰  } } ‡  ‡ ‡ ‡ ‡ f d †  }	 | j ˆ j d j ƒ  ˆ j d |	 g  f ƒ x6 ˆ j D]+ } | j | j ƒ  | | j	 ˆ g f ƒ q¹Wx6 ˆ j$ D]+ } | j | j ƒ  | | j	 ˆ g f ƒ qòWx6 ˆ j% D]+ } | j | j ƒ  | | j	 ˆ g f ƒ q+Wg  | D] }
 |
 d j& ƒ  sa|
 ^ qa} | j' d t( d ƒ ƒ x$ | D] \ } } } } | | Œ  q Wˆ j) d ƒ ˆ ˆ _* ˆ j+ j, ˆ ƒ d S(   su   
        Render the figure using :class:`matplotlib.backend_bases.RendererBase`
        instance *renderer*.
        Nt   figurei   c            sS   ˆ j  ƒ  }  |  j ˆ j ƒ |  j ˆ j ƒ  ƒ ˆ j |  ˆ ˆ  ˆ ƒ |  j ƒ  d  S(   N(   t   new_gct   set_clip_rectangleR]   t   set_clip_patht   get_clip_patht
   draw_imaget   restore(   t   gc(   RÃ   RÒ   t   lt   rendererR   (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   draw_compositeò  s
    i    R*   (-   t   get_visiblet
   open_groupR�   R>   R}   R�   R2   Rm   Ro   t   drawR¦   RÈ   t
   get_zorderR¥   R¤   t   option_image_nocompositeR  R)   R:   R¨   Rf   t   allequalRÑ   t   get_image_magnificationt
   make_imaget   oxt   oyt	   get_alphaR	   t   from_imagesR]   Rb   Ra   Rs   t   is_grayscalet   boundsR§   R©   t   get_animatedR!   R   t   close_groupR{   Ru   t
   draw_event(   R   R  t   dsuR#   t   not_compositet   magt   imsRØ   RÙ   R  t   rowt   zorderRï   R³   (    (   RÃ   RÒ   R  R  R   sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR  ¹  s`    	)))),:		 ))))	c         C  s)   |  j  d k	 s t ‚ | j |  j  ƒ d S(   s†   
        draw :class:`matplotlib.artist.Artist` instance *a* only --
        this is available only after the figure is drawn
        N(   R{   R)   Rú   R  (   R   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   draw_artist  s    c         C  s   |  j  S(   N(   R>   (   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR™     s    c         O  s,   t  |  | | | | Ž } |  j j | ƒ | S(   s–  
        Place a legend in the figure.  Labels are a sequence of
        strings, handles is a sequence of
        :class:`~matplotlib.lines.Line2D` or
        :class:`~matplotlib.patches.Patch` instances, and loc can be a
        string or an integer specifying the legend location

        USAGE::

          legend( (line1, line2, line3),
                  ('label1', 'label2', 'label3'),
                  'upper right')

        The *loc* location codes are::

          'best' : 0,          (currently not supported for figure legends)
          'upper right'  : 1,
          'upper left'   : 2,
          'lower left'   : 3,
          'lower right'  : 4,
          'right'        : 5,
          'center left'  : 6,
          'center right' : 7,
          'lower center' : 8,
          'upper center' : 9,
          'center'       : 10,

        *loc* can also be an (x,y) tuple in figure coords, which
        specifies the lower left of the legend box.  figure coords are
        (0,0) is the left, bottom of the figure and 1,1 is the right,
        top.

        Keyword arguments:

          *prop*: [ *None* | FontProperties | dict ]
            A :class:`matplotlib.font_manager.FontProperties`
            instance. If *prop* is a dictionary, a new instance will be
            created with *prop*. If *None*, use rc settings.

          *numpoints*: integer
            The number of points in the legend line, default is 4

          *scatterpoints*: integer
            The number of points in the legend line, default is 4

          *scatteryoffsets*: list of floats
            a list of yoffsets for scatter symbols in legend

          *markerscale*: [ *None* | scalar ]
            The relative size of legend markers vs. original. If *None*, use rc
            settings.

          *fancybox*: [ *None* | *False* | *True* ]
            if *True*, draw a frame with a round fancybox.  If *None*, use rc

          *shadow*: [ *None* | *False* | *True* ]
            If *True*, draw a shadow behind legend. If *None*, use rc settings.

          *ncol* : integer
            number of columns. default is 1

          *mode* : [ "expand" | *None* ]
            if mode is "expand", the legend will be horizontally expanded
            to fill the axes area (or *bbox_to_anchor*)

          *title* : string
            the legend title

        Padding and spacing between various elements use following keywords
        parameters. The dimensions of these values are given as a fraction
        of the fontsize. Values from rcParams will be used if None.

        ================   ====================================================
        Keyword            Description
        ================   ====================================================
        borderpad          the fractional whitespace inside the legend border
        labelspacing       the vertical space between the legend entries
        handlelength       the length of the legend handles
        handletextpad      the pad between the legend handle and text
        borderaxespad      the pad between the axes and legend border
        columnspacing      the spacing between columns
        ================   ====================================================

        .. Note:: Not all kinds of artist are supported by the legend.
                  See LINK (FIXME) for details.

        **Example:**

        .. plot:: mpl_examples/pylab_examples/figlegend_demo.py
        (   R   R©   RÈ   (   R   t   handlest   labelsR³   R´   R  (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   legend  s    [c         O  s[   t  i  | | Ž } t d | d | d | ƒ } | j | ƒ |  j | ƒ |  j j | ƒ | S(   sn  
        Add text to figure.

        Call signature::

          text(x, y, s, fontdict=None, **kwargs)

        Add text to figure at location *x*, *y* (relative 0-1
        coords). See :func:`~matplotlib.pyplot.text` for the meaning
        of the other arguments.

        kwargs control the :class:`~matplotlib.text.Text` properties:

        %(Text)s
        R¯   R°   R»   (   R   R   RH   Rq   R§   RÈ   (   R   R¯   R°   RY   R³   R´   t   overrideR¿   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR»   |  s    c         C  s0   | |  k r | j  |  ƒ n  | j |  j ƒ d  S(   N(   t
   set_figuret   set_transformRn   (   R   R#   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRq   –  s    c         K  s›   |  j  j ƒ  \ } } | d k	 r… | s+ | S| j ƒ  } t |  | � \ } } } | d } | d } | | k r… t | | ƒ r… | Sn  |  j d d d | � S(   s  
        Return the current axes, creating one if necessary

        The following kwargs are supported for ensuring the returned axes
        adheres to the given projection etc., and for axes creation if
        the active axes does not exist:

        %(Axes)s

        i   N(   Ry   R?   R)   t   copyR   R1   R   (   R   R´   t   ckeyt   caxt   kwargs_copyRü   t   _R*   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   gca›  s    

c         C  s2   |  j  j | ƒ x |  j D] } | |  ƒ q W| S(   s)   Set the current axes to be a and return a(   Ry   R0   Rî   (   R   R#   Rï   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRø   Ç  s    c         C  sy   |  j  j ƒ  d } | d k r# d S| j ƒ  } | d k	 r? | Sx3 t |  j ƒ D]" } | j ƒ  } | d k	 rO | SqO Wd S(   sZ   
        helper for :func:`~matplotlib.pyplot.gci`;
        do not use elsewhere.
        i   N(   Ry   R?   R)   t   _gcit   reversedR>   (   R   R0  RÒ   RŸ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR4  Î  s    c         C  sœ   |  j  j ƒ  } x d	 D] } | j | d  ƒ q Wt | d <t |  j d d  ƒ d  k	 r˜ |  j j } d d  l } | | j	 j
 j j ƒ  k r˜ t | d <q˜ n  | S(
   NRî   R€   Ru   R{   t   __mpl_version__R~   iÿÿÿÿt   _restore_to_pylab(   s   _axobserverss   shows   canvass   _cachedRenderer(   t   __dict__R.  Rº   R)   t   _mpl_versionRV   Ru   R~   t   matplotlib._pylab_helperst   _pylab_helperst   Gcft   figst   valuesRF   (   R   t   statet   attr_to_popR~   t
   matplotlib(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   __getstate__ä  s    

c   	        sB  | j  d ƒ } | j  d t ƒ } | t k rP d d  l } | j d | f ƒ n  | |  _ g  |  _ d  |  _ | r>d d  l	 j
 } d d  l j ‰ | j ƒ  } | r± t | ƒ d n d } | j j | |  ƒ ‰  |  j ƒ  rî ˆ  j |  j ƒ  ƒ n  ‡  ‡ f d †  } ˆ  j j d | ƒ ˆ  _ ˆ j j ˆ  ƒ | |  _ | j ƒ  n  d  S(   NR6  R7  iÿÿÿÿsW   This figure was saved with matplotlib version %s and is unlikely to function correctly.i   c           s   ˆ j  j ˆ  ƒ d  S(   N(   R<  t
   set_active(   t   event(   t   mgrt   pylab_helpers(    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   make_active  s    t   button_press_event(   Rº   Rs   R9  R5   R6   R8  Rî   R)   Ru   t   matplotlib.pyplott   pyplotR:  R;  t   get_fignumst   maxt   _backend_modt   new_figure_manager_given_figuret	   get_labelt   set_window_titlet   mpl_connectt   _cidgcfR<  RC  t   numbert   draw_if_interactive(	   R   R?  t   versiont   restore_to_pylabR5   t   pltt   allnumst   numRG  (    (   RE  RF  sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   __setstate__û  s.    					c         C  s   |  j  j | ƒ d S(   s=   whenever the axes state change, ``func(self)`` will be calledN(   Rî   RÈ   (   R   Rï   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   add_axobserver%  s    c   
      O  sŒ  | j  d t d ƒ | j d t d ƒ } | j d t ƒ } | rÁ | j  d d ƒ | j  d d ƒ g  } x~ |  j D]H } | j } | j | j ƒ  | j ƒ  f ƒ | j	 d ƒ | j
 d ƒ qr Wn( | j  d t d	 ƒ | j  d t d
 ƒ | r|  j ƒ  } |  j | ƒ n  |  j j | | Ž  | r4|  j | ƒ n  | rˆxK t |  j | ƒ D]4 \ } }	 | j j	 |	 d ƒ | j j
 |	 d ƒ qMWn  d S(   s]  
        Save the current figure.

        Call signature::

          savefig(fname, dpi=None, facecolor='w', edgecolor='w',
                  orientation='portrait', papertype=None, format=None,
                  transparent=False, bbox_inches=None, pad_inches=0.1,
                  frameon=None)

        The output formats available depend on the backend being used.

        Arguments:

          *fname*:
            A string containing a path to a filename, or a Python
            file-like object, or possibly some backend-dependent object
            such as :class:`~matplotlib.backends.backend_pdf.PdfPages`.

            If *format* is *None* and *fname* is a string, the output
            format is deduced from the extension of the filename. If
            the filename has no extension, the value of the rc parameter
            ``savefig.format`` is used.

            If *fname* is not a string, remember to specify *format* to
            ensure that the correct backend is used.

        Keyword arguments:

          *dpi*: [ *None* | ``scalar > 0`` ]
            The resolution in dots per inch.  If *None* it will default to
            the value ``savefig.dpi`` in the matplotlibrc file.

          *facecolor*, *edgecolor*:
            the colors of the figure rectangle

          *orientation*: [ 'landscape' | 'portrait' ]
            not supported on all backends; currently only on postscript output

          *papertype*:
            One of 'letter', 'legal', 'executive', 'ledger', 'a0' through
            'a10', 'b0' through 'b10'. Only supported for postscript
            output.

          *format*:
            One of the file extensions supported by the active
            backend.  Most backends support png, pdf, ps, eps and svg.

          *transparent*:
            If *True*, the axes patches will all be transparent; the
            figure patch will also be transparent unless facecolor
            and/or edgecolor are specified via kwargs.
            This is useful, for example, for displaying
            a plot on top of a colored background on a web page.  The
            transparency of these patches will be restored to their
            original values upon exit of this function.

          *frameon*:
            If *True*, the figure patch will be colored, if *False*, the
            figure background will be transparent.  If not provided, the
            rcParam 'savefig.frameon' will be used.

          *bbox_inches*:
            Bbox in inches. Only the given portion of the figure is
            saved. If 'tight', try to figure out the tight bbox of
            the figure.

          *pad_inches*:
            Amount of padding around the figure when bbox_inches is
            'tight'.

          *bbox_extra_artists*:
            A list of extra artists that will be considered when the
            tight bbox is calculated.

        Rj   s   savefig.dpiRm   s   savefig.frameont   transparentRc   t   noneRd   s   savefig.facecolors   savefig.edgecolori    i   N(   t
   setdefaultR   Rº   Rs   R>   Ro   RÈ   Rà   Rß   Rç   Rå   Rä   Rí   Ru   t   print_figuret   zip(
   R   R³   R´   Rm   R\  t   original_axes_colorsRŸ   Ro   t   original_frameont   cc(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   savefig)  s2    N	c         K  s±   | d k r |  j ƒ  } n  |  j ƒ  } | d k r~ | rc t | t ƒ rc t j | | � \ } } q~ t j | | � \ } } n  | j t ƒ t j	 | | | � } |  j
 | ƒ | S(   sš   
        Create a colorbar for a ScalarMappable instance, *mappable*.

        Documentation for the pylab thin wrapper:
        %(colorbar_doc)s
        N(   R)   R3  R1   R   t   cbart   make_axes_gridspect	   make_axesRÄ   RF   t   colorbar_factoryRø   (   R   t   mappableR0  RŸ   t   use_gridspect   kwt
   current_axt   cb(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   colorbar—  s    c         O  sß   |  j  j | | Ž  xÅ |  j D]º } t | t ƒ s½ | j d k	 rv t | j t ƒ rv | j j ƒ  | j | j j	 ƒ q× | j
 d k	 r× t | j
 t ƒ r× | j
 j ƒ  | j | j
 j	 ƒ q× q | j ƒ  | j | j	 ƒ q Wd S(   s%  
        Call signature::

          subplots_adjust(left=None, bottom=None, right=None, top=None,
                              wspace=None, hspace=None)

        Update the :class:`SubplotParams` with *kwargs* (defaulting to rc when
        *None*) and update the subplot locations

        N(   Rw   RH   R>   R1   R   t   _sharexR)   t   update_paramsR½   t   figboxt   _sharey(   R   R³   R´   RŸ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyRœ   °  s    
i   i   i   c         C  s7   t  |  d | d | d | ƒ} | d | d | d | ƒ S(   s³  
        Call signature::

          ginput(self, n=1, timeout=30, show_clicks=True,
                 mouse_add=1, mouse_pop=3, mouse_stop=2)

        Blocking call to interact with the figure.

        This will wait for *n* clicks from the user and return a list of the
        coordinates of each click.

        If *timeout* is zero or negative, does not timeout.

        If *n* is zero or negative, accumulate clicks until a middle click
        (or potentially both mouse buttons at once) terminates the input.

        Right clicking cancels last input.

        The buttons used for the various actions (adding points, removing
        points, terminating the inputs) can be overriden via the
        arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
        the associated mouse button: 1 for left, 2 for middle, 3 for
        right.

        The keyboard can also be used to select points in case your mouse
        does not have one or more of the buttons.  The delete and backspace
        keys act like right clicking (i.e., remove last point), the enter key
        terminates input and any other key (not already used by the window
        manager) selects a point.
        t	   mouse_addt	   mouse_popt
   mouse_stopt   nt   timeoutt   show_clicks(   R   (   R   Rv  Rw  Rx  Rs  Rt  Ru  t   blocking_mouse_input(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   ginputË  s    !		iÿÿÿÿc         C  s   t  |  ƒ } | d | ƒ S(   sd  
        Call signature::

          waitforbuttonpress(self, timeout=-1)

        Blocking call to interact with the figure.

        This will return True is a key was pressed, False if a mouse
        button was pressed and None if *timeout* was reached without
        either being pressed.

        If *timeout* is negative, does not timeout.
        Rw  (   R   (   R   Rw  t   blocking_input(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   waitforbuttonpressó  s    c         C  su   g  |  j  ƒ  D] } | j ƒ  r | ^ q } x3 |  j D]( } | j ƒ  r5 | j | j ƒ  ƒ q5 q5 W| j |  j ƒ | S(   N(   R«   R  R>   R£   t   get_default_bbox_extra_artistsR/   Ro   (   R   t   artistt   bbox_artistsRŸ   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR}    s    c         C  s¥   g  } x6 |  j  D]+ } | j ƒ  r | j | j | ƒ ƒ q q Wt j g  | D]* } | j d k sp | j d k rL | ^ qL ƒ } t | t	 ƒ  j
 d |  j ƒ ƒ } | S(   s«   
        Return a (tight) bounding box of the figure in inches.

        It only accounts axes title, axis labels, and axis
        ticklabels. Needs improvement.
        i    g      ð?(   R>   R  RÈ   t   get_tightbboxR   t   unionRa   Rb   R   R   R‰   Rj   (   R   R  t   bbRŸ   RÃ   t   _bboxRl   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR€    s    @gHáz®Gñ?c         C  s£   d d l  m } m } m } | |  j ƒ }	 d |	 k rG t j d ƒ n  | d k rb | |  ƒ } n  | |  |  j |	 | d | d | d | d | ƒ}
 |  j |
 �  d S(	   sx  
        Adjust subplot parameters to give specified padding.

        Parameters:

          *pad* : float
            padding between the figure edge and the edges of subplots,
            as a fraction of the font-size.
          *h_pad*, *w_pad* : float
            padding (height/width) between edges of adjacent subplots.
            Defaults to `pad_inches`.
          *rect* : if rect is given, it is interpreted as a rectangle
            (left, bottom, right, top) in the normalized figure
            coordinate that the whole subplots area (including
            labels) will fit into. Default is (0, 0, 1, 1).
        iÿÿÿÿ(   t   get_renderert   get_tight_layout_figuret   get_subplotspec_listsg   This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.t   padt   h_padt   w_padRû   N(	   R}   R„  R…  R†  R>   R)   R5   R6   Rœ   (   R   R  R‡  Rˆ  R‰  Rû   R„  R…  R†  t   subplotspec_listR´   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR}   #  s    	N(D   RB   RC   RD   R_   R)   R   RF   R€   R‚   t   propertyR>   R†   R‹   Rj   R�   Rx   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   dedent_interpdRý   R   Rs   Rz   Rˆ   R   R  R'  R™   R*  R»   Rq   R3  Rø   R4  RB  RZ  R[  Rd  Rn  Rœ   Rz  R|  R}  R€  R}   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyR[   é   s˜   	N 					'				*	F	#															QM	Y			_	,				*		n	'	
		c   	      C  sÓ   t  |  d ƒ } t j d	 ƒ } t j d
 ƒ } | rY |  j d  \ } } t | ƒ | } n t |  ƒ } t d d } t j | | | f ƒ } | t d | | Œ :} | t d | | Œ :} t j | | | ƒ } | S(   s;  
    Create a figure with specified aspect ratio.  If *arg* is a number,
    use that aspect ratio.  If *arg* is an array, figaspect will
    determine the width and height for a figure that would fit array
    preserving aspect ratio.  The figure width, height in inches are
    returned.  Be sure to create an axes with equal with and height,
    eg

    Example usage::

      # make a figure twice as tall as it is wide
      w, h = figaspect(2.)
      fig = Figure(figsize=(w,h))
      ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
      ax.imshow(A, **kwargs)


      # make a figure with the proper aspect for an array
      A = rand(5,3)
      w, h = figaspect(A)
      fig = Figure(figsize=(w,h))
      ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
      ax.imshow(A, **kwargs)

    Thanks to Fernando Perez for this function
    t   shapeg      @g       @g      0@i   s   figure.figsizei   g      ð?(   g      @g       @(   g      0@g      0@(	   R•   R“   t   arrayR�  t   floatR   t   minRL  t   clip(	   t   argt   isarrayt   figsize_mint   figsize_maxt   nrt   nct	   arr_ratiot
   fig_heightt   newsize(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt	   figaspectJ  s    (;   RD   t
   __future__R    R5   t   operatorR   t   numpyR“   RA  R   R   R   R9  t   matplotlib.artistR~  t   martistR   R   t   matplotlib.cbookRf   R   R   R	   t   matplotlib.imageR
   t   matplotlib.colorbarRn  Re  t   matplotlib.axesR   R   R   t   matplotlib.blocking_inputR   R   t   matplotlib.legendR   t   matplotlib.patchesR   t   matplotlib.projectionsR   R   t   matplotlib.textR   R   t   matplotlib.transformsR   R   R   R   t   matplotlib.backend_basesR   t   interpdRH   R   RE   R[   R›  t   kwdoc(    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/figure.pyt   <module>   sB   "dSÿ ÿ ÿ ÿ ÿ f	=