ó
±éRc           @  s  d  Z  d d l m Z 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
 j Z d d l j Z d d l j Z d d l j Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z m Z m Z d d l j Z d d l j Z d d	 l m  Z  d d
 l
 m! Z! y d d l" m# Z# e$ Z% Wn e& k
 rae' Z% n Xi  Z( d „  Z) d e* f d „  ƒ  YZ+ d f  d „  ƒ  YZ, d f  d „  ƒ  YZ- d e* f d „  ƒ  YZ. d f  d „  ƒ  YZ/ d e/ f d „  ƒ  YZ0 d e/ f d „  ƒ  YZ1 d e/ f d „  ƒ  YZ2 d e/ f d „  ƒ  YZ3 d e/ f d  „  ƒ  YZ4 d! e4 f d" „  ƒ  YZ5 d# e/ f d$ „  ƒ  YZ6 d% e4 f d& „  ƒ  YZ7 d' e* f d( „  ƒ  YZ8 e9 d) „ Z: d* e; f d+ „  ƒ  YZ< d, f  d- „  ƒ  YZ= d. f  d/ „  ƒ  YZ> e> ƒ  Z? d0 e* f d1 „  ƒ  YZ@ d S(2   s¼  
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a matplotlib backend

:class:`RendererBase`
    An abstract base class to handle drawing/rendering operations.

:class:`FigureCanvasBase`
    The abstraction layer that separates the
    :class:`matplotlib.figure.Figure` from the backend specific
    details like a user interface drawing area

:class:`GraphicsContextBase`
    An abstract base class that provides color, line styles, etc...

:class:`Event`
    The base class for all of the matplotlib event
    handling.  Derived classes suh as :class:`KeyEvent` and
    :class:`MouseEvent` store the meta data like keys and buttons
    pressed, x and y locations in pixel and
    :class:`~matplotlib.axes.Axes` coordinates.

:class:`ShowBase`
    The base class for the Show class of each interactive backend;
    the 'show' callable is then set to Show.__call__, inherited from
    ShowBase.

iÿÿÿÿ(   t   divisiont   print_functionN(   t   rcParams(   t   is_interactive(   t   get_backend(   t   Gcf(   t   Bboxt   TransformedBboxt   Affine2D(   t   Path(   t   mplDeprecation(   t   Imagec         C  s   | t  |  <d  S(   N(   t
   _backend_d(   t   formatt   backend_class(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   register_backend?   s    t   ShowBasec           B  s#   e  Z d  Z d d „ Z d „  Z RS(   su   
    Simple base class to generate a show() callable in backends.

    Subclass must override mainloop() method.
    c         C  sÜ   t  j ƒ  } | s d Sx | D] } | j ƒ  q W| d k	 rX | rQ |  j ƒ  d Sd Sn  d d l m } y& | j j } | oŠ t ƒ  d k } Wn t	 k
 r§ t
 } n X| r² d St ƒ  sË t ƒ  d k rØ |  j ƒ  n  d S(   sB  
        Show all figures.  If *block* is not None, then
        it is a boolean that overrides all other factors
        determining whether show blocks by calling mainloop().
        The other factors are:
        it does not block if run inside "ipython --pylab";
        it does not block in interactive mode.
        Niÿÿÿÿ(   t   pyplott   WebAgg(   R   t   get_all_fig_managerst   showt   Nonet   mainloopt
   matplotlibR   t	   _needmainR   t   AttributeErrort   FalseR   (   t   selft   blockt   managerst   managerR   t   ipython_pylab(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   __call__I   s(    	

c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR   w   s    N(   t   __name__t
   __module__t   __doc__R   R    R   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR   C   s   .t   RendererBasec           B  s1  e  Z d  Z d „  Z d  d „ Z d „  Z d  d „ Z d  d „ Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d  d „ Z e d  d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" RS(!   s¶  An abstract base class to handle drawing/rendering operations.

    The following methods *must* be implemented in the backend:

    * :meth:`draw_path`
    * :meth:`draw_image`
    * :meth:`draw_text`
    * :meth:`get_text_width_height_descent`

    The following methods *should* be implemented in the backend for
    optimization reasons:

    * :meth:`draw_markers`
    * :meth:`draw_path_collection`
    * :meth:`draw_quad_mesh`
    c         C  s   d  |  _ t j ƒ  |  _ d  S(   N(   R   t   _texmanagert   textpatht
   TextToPatht
   _text2path(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   __init__Œ   s    	c         C  s   d S(   sÁ   
        Open a grouping element with label *s*. If *gid* is given, use
        *gid* as the id of the group. Is only currently used by
        :mod:`~matplotlib.backends.backend_svg`.
        N(    (   R   t   st   gid(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   open_group‘   s    c         C  s   d S(   sƒ   
        Close a grouping element with label *s*
        Is only currently used by :mod:`~matplotlib.backends.backend_svg`
        N(    (   R   R*   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   close_group™   s    c         C  s
   t  ‚ d S(   sk   
        Draws a :class:`~matplotlib.path.Path` instance using the
        given affine transform.
        N(   t   NotImplementedError(   R   t   gct   patht	   transformt   rgbFace(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   draw_path    s    c         C  su   xn | j  | d t ƒD]W \ } } t | ƒ r | d \ }	 }
 |  j | | | t j ƒ  j |	 |
 ƒ | ƒ q q Wd S(   sÎ  
        Draws a marker at each of the vertices in path.  This includes
        all vertices, including control points on curves.  To avoid
        that behavior, those vertices should be removed before calling
        this function.

        *gc*
            the :class:`GraphicsContextBase` instance

        *marker_trans*
            is an affine transform applied to the marker.

        *trans*
             is an affine transform applied to the path.

        This provides a fallback implementation of draw_markers that
        makes multiple calls to :meth:`draw_path`.  Some backends may
        want to override this method in order to draw the marker only
        once and reuse it multiple times.
        t   simplifyiþÿÿÿN(   t   iter_segmentsR   t   lenR3   t
   transformsR   t	   translate(   R   R/   t   marker_patht   marker_transR0   t   transR2   t   verticest   codest   xt   y(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_markers§   s    "c         C  sÓ   g  } x6 |  j  | | | ƒ D] \ } } | j | | f ƒ q Wx� |  j | | | | | | | | |	 |
 | | | ƒ D]X \ } } } } } | \ } } t j | j ƒ  ƒ j | | ƒ } |  j | | | | ƒ qs Wd S(   s‡  
        Draws a collection of paths selecting drawing properties from
        the lists *facecolors*, *edgecolors*, *linewidths*,
        *linestyles* and *antialiaseds*. *offsets* is a list of
        offsets to apply to each of the paths.  The offsets in
        *offsets* are first transformed by *offsetTrans* before being
        applied.  *offset_position* may be either "screen" or "data"
        depending on the space that the offsets are in.

        This provides a fallback implementation of
        :meth:`draw_path_collection` that makes multiple calls to
        :meth:`draw_path`.  Some backends may want to override this in
        order to render each set of path data only once, and then
        reference that path multiple times with the different offsets,
        colors, styles etc.  The generator methods
        :meth:`_iter_collection_raw_paths` and
        :meth:`_iter_collection` are provided to help with (and
        standardize) the implementation across backends.  It is highly
        recommended to use those generators, so that changes to the
        behavior of :meth:`draw_path_collection` can be made globally.
        N(   t   _iter_collection_raw_pathst   appendt   _iter_collectionR7   R   t
   get_matrixR8   R3   (   R   R/   t   master_transformt   pathst   all_transformst   offsetst   offsetTranst
   facecolorst
   edgecolorst
   linewidthst
   linestylest   antialiasedst   urlst   offset_positiont   path_idsR0   R1   t   xot   yot   path_idt   gc0R2   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_path_collectionÅ   s    		"c         C  s�   d d l  m } | j | | | ƒ } |
 d k r: | }
 n  t j | j ƒ  g t j ƒ } |  j | | | g  | | | |
 | g  |	 g d g d ƒ S(   s¥   
        This provides a fallback implementation of
        :meth:`draw_quad_mesh` that generates paths and then calls
        :meth:`draw_path_collection`.
        iÿÿÿÿ(   t   QuadMesht   screenN(	   t   matplotlib.collectionsRW   t   convert_mesh_to_pathsR   t   npt   arrayt   get_linewidtht   float_RV   (   R   R/   RE   t	   meshWidtht
   meshHeightt   coordinatesRH   RI   RJ   t   antialiasedRK   RW   RF   RL   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_quad_meshì   s    		c         C  s
   t  ‚ d S(   s  
        Draw a Gouraud-shaded triangle.

        *points* is a 3x2 array of (x, y) points for the triangle.

        *colors* is a 3x4 array of RGBA colors for each point of the
        triangle.

        *transform* is an affine transform to apply to the points.
        N(   R.   (   R   R/   t   pointst   colorsR1   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_gouraud_triangle  s    c         C  sF   | j  ƒ  } x3 t | | ƒ D]" \ } } |  j | | | | ƒ q Wd S(   s  
        Draws a series of Gouraud triangles.

        *points* is a Nx3x2 array of (x, y) points for the trianglex.

        *colors* is a Nx3x4 array of RGBA colors for each point of the
        triangles.

        *transform* is an affine transform to apply to the points.
        N(   t   frozent   zipRf   (   R   R/   t   triangles_arrayt   colors_arrayR1   t   trit   col(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_gouraud_triangles  s    c   
      c  s’   t  | ƒ } t  | ƒ } t | | ƒ } | d k r7 d St j ƒ  } xH t | ƒ D]: } | | | }	 | r{ | | | } n  |	 | | f VqP Wd S(   sI  
        This is a helper method (along with :meth:`_iter_collection`) to make
        it easier to write a space-efficent :meth:`draw_path_collection`
        implementation in a backend.

        This method yields all of the base path/transform
        combinations, given a master transform, a list of paths and
        list of transforms.

        The arguments should be exactly what is passed in to
        :meth:`draw_path_collection`.

        The backend should take each yielded path and transform and
        create an object that can be referenced (reused) later.
        i    N(   R6   t   maxR7   t   IdentityTransformt   xrange(
   R   RE   RF   RG   t   Npathst   Ntransformst   NR1   t   iR0   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRA     s    c   #      c  s5  t  | ƒ } t  | ƒ } t  | ƒ } t | | ƒ } t  | ƒ } t  | ƒ } t  |	 ƒ } t  |
 ƒ } t  | ƒ } t  | ƒ } | d k r“ | d k sŸ | d k r£ d S| r» | j | ƒ } n  |  j ƒ  } | j | ƒ | d k ré d } n  | d k r| j d ƒ n  d \ } } xt | ƒ D]} | | | } | rÅ| | | \ } } | d k rÅ| rs| | | | } n | } | j | | f ƒ \ } } | j d ƒ \ }  }! |  | } |! | } qÅn  t	 j
 | ƒ oàt	 j
 | ƒ séqn  | r | | | } n  | r¢| r$| j |	 | | ƒ n  | rB| j |
 | | Œ  n  | | | }" t  |" ƒ d k r’|" d d k r‚| j d ƒ qŸ| j |" ƒ q¢| j |" ƒ n  | d k	 rÜt  | ƒ d k rÜ| d d k rÜd } qÜn  | j | | | ƒ | r| j | | | ƒ n  | | | | | f VqW| j ƒ  d S(	   s  
        This is a helper method (along with
        :meth:`_iter_collection_raw_paths`) to make it easier to write
        a space-efficent :meth:`draw_path_collection` implementation in a
        backend.

        This method yields all of the path, offset and graphics
        context combinations to draw the path collection.  The caller
        should already have looped over the results of
        :meth:`_iter_collection_raw_paths` to draw this collection.

        The arguments should be the same as that passed into
        :meth:`draw_path_collection`, with the exception of
        *path_ids*, which is a list of arbitrary objects that the
        backend will use to reference one of the paths created in the
        :meth:`_iter_collection_raw_paths` stage.

        Each yielded result is of the form::

           xo, yo, path_id, gc, rgbFace

        where *xo*, *yo* is an offset; *path_id* is one of the elements of
        *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
        use for filling the path.
        i    Ng        t   datai   i   (   i    i    (   i    i    (   R6   Rn   R1   t   new_gct   copy_propertiesR   t   set_linewidthRp   t   transform_pointR[   t   isfinitet
   set_dashest   set_foregroundt   set_antialiasedt   set_urlt   restore(#   R   R/   RE   RG   RQ   RH   RI   RJ   RK   RL   RM   RN   RO   RP   Rr   Rq   t   NoffsetsRs   t   Nfacecolorst   Nedgecolorst   Nlinewidthst   Nlinestylest   Naat   Nurlst   toffsetsRU   R2   RR   RS   Rt   RT   R1   t   xpt   ypt   fg(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRC   =  sr    $	
c         C  s   d S(   sµ   
        Get the factor by which to magnify images passed to :meth:`draw_image`.
        Allows a backend to have images at a different resolution to other
        artists.
        g      ð?(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_image_magnification�  s    c         C  s
   t  ‚ d S(   sê  
        Draw the image instance into the current axes;

        *gc*
            a GraphicsContext containing clipping information

        *x*
            is the distance in pixels from the left hand side of the canvas.

        *y*
            the distance from the origin.  That is, if origin is
            upper, y is the distance from top.  If origin is lower, y
            is the distance from bottom

        *im*
            the :class:`matplotlib._image.Image` instance
        N(   R.   (   R   R/   R>   R?   t   im(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   draw_image¥  s    c         C  s   t  S(   sŒ   
        override this method for renderers that do not necessarily
        want to rescale and composite raster images. (like SVG)
        (   R   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   option_image_nocomposite¹  s    c         C  s   t  S(   s‚   
        override this method for renderers that support arbitrary
        scaling of image (most of the vector backend).
        (   R   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   option_scale_imageÀ  s    s   TeX!c	   	   	   C  s&   |  j  | | | | | | d d ƒd S(   s	   
        t   ismatht   TeXN(   t   _draw_text_as_path(	   R   R/   R>   R?   R*   t   propt   angleR�   t   mtext(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_texÇ  s    c	   	      C  s#   |  j  | | | | | | | ƒ d S(   s‰  
        Draw the text instance

        *gc*
            the :class:`GraphicsContextBase` instance

        *x*
            the x location of the text in display coords

        *y*
            the y location of the text baseline in display coords

        *s*
            the text string

        *prop*
          a :class:`matplotlib.font_manager.FontProperties` instance

        *angle*
            the rotation angle in degrees

        *mtext*
            a :class:`matplotlib.text.Text` instance

        **backend implementers note**

        When you are trying to determine if you have gotten your bounding box
        right (which is what enables the text layout/alignment to work
        properly), it helps to change the line in text.py::

            if 0: bbox_artist(self, renderer)

        to if 1, and then the actual bounding box will be plotted along with
        your text.
        N(   R’   (	   R   R/   R>   R?   R*   R“   R”   R�   R•   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   draw_textÌ  s    %c         C  s.  |  j  } |  j | j ƒ  ƒ } | d k rQ | j | | d t d t ƒ\ }	 }
 n$ | j | | d | d t ƒ\ }	 }
 t |	 |
 ƒ } | d d } |  j ƒ  ræ t ƒ  j	 | | j
 | | j
 ƒ } | j | ƒ j | |  j | ƒ } n> t ƒ  j	 | | j
 | | j
 ƒ } | j | ƒ j | | ƒ } | | f S(   s   
        return the text path and transform

        *prop*
          font property

        *s*
          text to be converted

        *usetex*
          If True, use matplotlib usetex mode.

        *ismath*
          If True, use mathtext parser. If "TeX", use *usetex* mode.
        R‘   R�   t   usetexg     €f@gz ‹üú!	@(   R(   t   points_to_pixelst   get_size_in_pointst   get_text_pathR   t   TrueR	   t   flipyR   t   scalet
   FONT_SCALEt   rotateR8   t   height(   R   R>   R?   R*   R“   R”   R�   t	   text2patht   fontsizet   vertsR=   R0   R1   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _get_text_path_transformó  s"    	%c         C  sZ   |  j  | | | | | | ƒ \ } }	 | j ƒ  }
 | j d ƒ |  j | | |	 d |
 ƒd S(   s>  
        draw the text by converting them to paths using textpath module.

        *prop*
          font property

        *s*
          text to be converted

        *usetex*
          If True, use matplotlib usetex mode.

        *ismath*
          If True, use mathtext parser. If "TeX", use *usetex* mode.
        g        R2   N(   R¥   t   get_rgbRx   R3   (   R   R/   R>   R?   R*   R“   R”   R�   R0   R1   t   color(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR’     s
    c         C  s8  | d k ra | j  ƒ  } |  j j ƒ  } | j  ƒ  } | j | | d |  ƒ\ } } }	 | | |	 f S|  j d ƒ }
 | rœ |  j j j | |
 | ƒ } | d d !S|  j j ƒ  } |  j j | ƒ } | j  ƒ  } | j	 | |
 ƒ | j
 | d d | ƒ| j ƒ  \ } } | j ƒ  }	 | d } | d } |	 d }	 | | |	 f S(	   sÒ   
        get the width and height, and the offset from the bottom to the
        baseline (descent), in display coords of the string s with
        :class:`~matplotlib.font_manager.FontProperties` prop
        R‘   t   rendereriH   i    i   g        t   flagsg      P@(   Rš   R(   t   get_texmanagert   get_text_width_height_descentR™   t   mathtext_parsert   parset   _get_hinting_flagt	   _get_fontt   set_sizet   set_textt   get_width_heightt   get_descent(   R   R*   R“   R�   t   sizet
   texmanagerR£   t   wt   ht   dt   dpit   dimsR©   t   font(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR«   3  s,    


c         C  s   t  S(   s±   
        Return true if y small numbers are top for renderer Is used
        for drawing text (:mod:`matplotlib.text`) and images
        (:mod:`matplotlib.image`) only
        (   Rœ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR�   T  s    c         C  s   d S(   s4   return the canvas width and height in display coordsi   (   i   i   (    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_canvas_width_height\  s    c         C  s5   |  j  d k r. d d l m } | ƒ  |  _  n  |  j  S(   sO   
        return the :class:`matplotlib.texmanager.TexManager` instance
        iÿÿÿÿ(   t
   TexManagerN(   R%   R   t   matplotlib.texmanagerR½   (   R   R½   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRª   `  s    c         C  s   t  ƒ  S(   sF   
        Return an instance of a :class:`GraphicsContextBase`
        (   t   GraphicsContextBase(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRv   i  s    c         C  s   | S(   s   
        Convert points to display units

        *points*
            a float or a numpy array of float

        return points converted to pixels

        You need to override this function (unless your backend
        doesn't have a dpi, eg, postscript or svg).  Some imaging
        systems assume some value for pixels per inch::

            points to pixels = points * pixels_per_inch/72.0 * dpi/72.0
        (    (   R   Rd   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR™   o  s    c         C  s   t  j | ƒ S(   N(   t   cbookt
   strip_math(   R   R*   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÁ   €  s    c         C  s   d S(   sK   
        Used in MixedModeRenderer. Switch to the raster renderer.
        N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   start_rasterizingƒ  s    c         C  s   d S(   s°   
        Used in MixedModeRenderer. Switch back to the vector renderer
        and draw the contents of the raster renderer as an image on
        the vector renderer.
        N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   stop_rasterizing‰  s    c         C  s   d S(   sj   
        Used in AggRenderer. Switch to a temporary renderer for image
        filtering effects.
        N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   start_filter‘  s    c         C  s   d S(   sâ   
        Used in AggRenderer. Switch back to the original renderer.
        The contents of the temporary renderer is processed with the
        *filter_func* and is drawn on the original renderer as an
        image.
        N(    (   R   t   filter_func(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   stop_filter˜  s    N(#   R!   R"   R#   R)   R   R,   R-   R3   R@   RV   Rc   Rf   Rm   RA   RC   R‹   R�   RŽ   R�   R–   R   R—   R¥   R’   R«   R�   R¼   Rª   Rv   R™   RÁ   RÂ   RÃ   RÄ   RÆ   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR$   {   s>   			'					`				'	(		!										R¿   c           B  s•  e  Z d  Z i d/ d 6d d0 f d 6d d1 f d 6d d2 f d	 6Z 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 d „  Z d „  Z d „  Z d „  Z d „  Z d  „  Z e d! „ Z d" „  Z d# „  Z d$ „  Z  d% „  Z! d& „  Z" d' „  Z# d( „  Z$ d) „  Z% d* „  Z& d d+ „ Z' d, „  Z( d. d. d. d- „ Z) RS(3   sI   
    An abstract base class that provides color, line styles, etc...
    t   solidi    g      @t   dashedg      @g      @g      ð?t   dashdott   dottedc         C  s�   d |  _  t |  _ d |  _ d |  _ d  |  _ d  |  _ d |  _ d |  _	 d |  _
 d |  _ d |  _ d	 |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(
   Ng      ð?i   t   buttt   roundRÇ   g        (   NN(   g        g        g        g      ð?(   g        g        g        g      ð?(   t   _alphaR   t   _forced_alphat   _antialiasedt	   _capstyleR   t	   _cliprectt	   _clippatht   _dashest
   _joinstylet
   _linestylet
   _linewidtht   _rgbt   _orig_colort   _hatcht   _urlt   _gidt   _snapt   _sketch(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ¯  s"    																c         C  sÐ   | j  |  _  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j	 |  _	 | j
 |  _
 | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ d S(   s   Copy properties from gc to selfN(   RÍ   RÎ   RÏ   RÐ   RÑ   RÒ   RÓ   RÔ   RÕ   RÖ   R×   RØ   RÙ   RÚ   RÛ   RÜ   RÝ   (   R   R/   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRw   Â  s"    c         C  s   d S(   s‡   
        Restore the graphics context from the stack - needed only
        for backends that save graphics contexts on a stack
        N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR   Ö  s    c         C  s   |  j  S(   sb   
        Return the alpha value used for blending - not supported on
        all backends
        (   RÍ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   get_alphaÝ  s    c         C  s   |  j  S(   s@   Return true if the object should try to do antialiased rendering(   RÏ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_antialiasedä  s    c         C  s   |  j  S(   sT   
        Return the capstyle as a string in ('butt', 'round', 'projecting')
        (   RÐ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_capstyleè  s    c         C  s   |  j  S(   sf   
        Return the clip rectangle as a :class:`~matplotlib.transforms.Bbox`
        instance
        (   RÑ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_clip_rectangleî  s    c         C  s    |  j  d k	 r |  j  j ƒ  Sd S(   sÙ   
        Return the clip path in the form (path, transform), where path
        is a :class:`~matplotlib.path.Path` instance, and transform is
        an affine transform to apply to the path before clipping.
        N(   NN(   RÒ   R   t   get_transformed_path_and_affine(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_clip_pathõ  s    c         C  s   |  j  S(   sN  
        Return the dash information as an offset dashlist tuple.

        The dash list is a even size list that gives the ink on, ink
        off in pixels.

        See p107 of to PostScript `BLUEBOOK
        <http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF>`_
        for more info.

        Default value is None
        (   RÓ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   get_dashesÿ  s    c         C  s   |  j  S(   s‚   
        Return whether the value given by get_alpha() should be used to
        override any other alpha-channel values.
        (   RÎ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_forced_alpha  s    c         C  s   |  j  S(   sR   
        Return the line join style as one of ('miter', 'round', 'bevel')
        (   RÔ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_joinstyle  s    c         C  s   |  j  S(   s`   
        Return the linestyle: one of ('solid', 'dashed', 'dashdot',
        'dotted').
        (   RÕ   (   R   t   style(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_linestyle  s    c         C  s   |  j  S(   s=   
        Return the line width in points as a scalar
        (   RÖ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR]   "  s    c         C  s   |  j  S(   sC   
        returns a tuple of three or four floats from 0-1.
        (   R×   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR¦   (  s    c         C  s   |  j  S(   s=   
        returns a url if one is set, None otherwise
        (   RÚ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_url.  s    c         C  s   |  j  S(   sM   
        Return the object identifier if one is set, None otherwise.
        (   RÛ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_gid4  s    c         C  s   |  j  S(   s  
        returns the snap setting which may be:

          * True: snap vertices to the nearest pixel center

          * False: leave vertices as-is

          * None: (auto) If the path contains only rectilinear line
            segments, round to the nearest pixel center
        (   RÜ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_snap:  s    c         C  sG   | d k	 r! | |  _ t |  _ n d |  _ t |  _ |  j |  j ƒ d S(   sA  
        Set the alpha value used for blending - not supported on all backends.
        If ``alpha=None`` (the default), the alpha components of the
        foreground and fill colors will be used to set their respective
        transparencies (where applicable); otherwise, ``alpha`` will override
        them.
        g      ð?N(   R   RÍ   Rœ   RÎ   R   R|   RØ   (   R   t   alpha(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   set_alphaG  s    			c         C  s   | r d |  _  n	 d |  _  d S(   sK   
        True if object should be drawn with antialiased rendering
        i   i    N(   RÏ   (   R   t   b(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR}   W  s    c         C  s,   | d k r | |  _  n t d | ƒ ‚ d S(   sQ   
        Set the capstyle as a string in ('butt', 'round', 'projecting')
        RË   RÌ   t
   projectings!   Unrecognized cap style.  Found %sN(   s   butts   roundRï   (   RÐ   t
   ValueError(   R   t   cs(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_capstyleb  s    c         C  s   | |  _  d S(   sT   
        Set the clip rectangle with sequence (left, bottom, width, height)
        N(   RÑ   (   R   t	   rectangle(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_clip_rectanglek  s    c         C  s1   | d k s$ t | t j ƒ s$ t ‚ | |  _ d S(   s‹   
        Set the clip path and transformation.  Path should be a
        :class:`~matplotlib.transforms.TransformedPath` instance.
        N(   R   t
   isinstanceR7   t   TransformedPatht   AssertionErrorRÒ   (   R   R0   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_clip_pathq  s    $c         C  sU   | d k	 rB t j | ƒ } t j | d k ƒ rB t d ƒ ‚ qB n  | | f |  _ d S(   sí   
        Set the dash style for the gc.

        *dash_offset*
            is the offset (usually 0).

        *dash_list*
            specifies the on-off sequence as points.
            ``(None, None)`` specifies a solid line

        g        s,   All values in the dash list must be positiveN(   R   R[   t   asarrayt   anyRð   RÓ   (   R   t   dash_offsett	   dash_listt   dl(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR{   y  s
    c         C  s[   | |  _  |  j r0 t j j | |  j ƒ |  _ n' | rB | |  _ n t j j | ƒ |  _ d S(   s  
        Set the foreground color.  fg can be a MATLAB format string, a
        html hex color string, an rgb or rgba unit tuple, or a float between 0
        and 1.  In the latter case, grayscale is used.

        If you know fg is rgba, set ``isRGBA=True`` for efficiency.
        N(   RØ   RÎ   Re   t   colorConvertert   to_rgbaRÍ   R×   (   R   RŠ   t   isRGBA(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR|   ‹  s    		c         C  s%   | |  _  | | | |  j f |  _ d S(   sI   
        Set the foreground color to be a gray level with *frac*
        N(   RØ   RÍ   R×   (   R   t   frac(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_graylevel›  s    	c         C  s,   | d k r | |  _  n t d | ƒ ‚ d S(   sM   
        Set the join style to be one of ('miter', 'round', 'bevel')
        t   miterRÌ   t   bevels"   Unrecognized join style.  Found %sN(   s   miters   roundR  (   RÔ   Rð   (   R   t   js(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_joinstyle¢  s    c         C  s   | |  _  d S(   s-   
        Set the linewidth in points
        N(   RÖ   (   R   R¶   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRx   «  s    c         C  sv   | |  j  k r% |  j  | \ } } n4 t | t ƒ rC | \ } } n t d t | ƒ ƒ ‚ | |  _ |  j | | ƒ d S(   sƒ  
        Set the linestyle to be one of ('solid', 'dashed', 'dashdot',
        'dotted'). One may specify customized dash styles by providing
        a tuple of (offset, dash pairs). For example, the predefiend
        linestyles have following values.:

         'dashed'  : (0, (6.0, 6.0)),
         'dashdot' : (0, (3.0, 5.0, 1.0, 5.0)),
         'dotted'  : (0, (1.0, 3.0)),
        s   Unrecognized linestyle: %sN(   t   dashdRõ   t   tupleRð   t   strRÕ   R{   (   R   Rç   t   offsett   dashes(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_linestyle±  s    	c         C  s   | |  _  d S(   s?   
        Sets the url for links in compatible backends
        N(   RÚ   (   R   t   url(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR~   Ç  s    c         C  s   | |  _  d S(   s   
        Sets the id.
        N(   RÛ   (   R   t   id(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_gidÍ  s    c         C  s   | |  _  d S(   s  
        Sets the snap setting which may be:

          * True: snap vertices to the nearest pixel center

          * False: leave vertices as-is

          * None: (auto) If the path contains only rectilinear line
            segments, round to the nearest pixel center
        N(   RÜ   (   R   t   snap(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_snapÓ  s    c         C  s   | |  _  d S(   s2   
        Sets the hatch style for filling
        N(   RÙ   (   R   t   hatch(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   set_hatchà  s    c         C  s   |  j  S(   s.   
        Gets the current hatch style
        (   RÙ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   get_hatchæ  s    c         C  s&   |  j  d k r d St j |  j  | ƒ S(   s7   
        Returns a Path for the current hatch.
        N(   RÙ   R   R	   R  (   R   t   density(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_hatch_pathì  s    c         C  s   |  j  S(   sú  
        Returns the sketch parameters for the artist.

        Returns
        -------
        sketch_params : tuple or `None`

        A 3-tuple with the following elements:

          * `scale`: The amplitude of the wiggle perpendicular to the
            source line.

          * `length`: The length of the wiggle along the line.

          * `randomness`: The scale factor by which the length is
            shrunken or expanded.

        May return `None` if no sketch parameters were set.
        (   RÝ   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_sketch_paramsô  s    c         C  s:   | d k r d |  _ n | | p$ d | p- d f |  _ d S(   s8  
        Sets the the sketch parameters.

        Parameters
        ----------

        scale : float, optional
            The amplitude of the wiggle perpendicular to the source
            line, in pixels.  If scale is `None`, or not provided, no
            sketch filter will be provided.

        length : float, optional
             The length of the wiggle along the line, in pixels
             (default 128.0)

        randomness : float, optional
            The scale factor by which the length is shrunken or
            expanded (default 16.0)
        g      `@g      0@N(   R   RÝ   (   R   Rž   t   lengtht
   randomness(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_sketch_params
  s    N(   NN(   g      @g      @(   g      @g      @g      ð?g      @(   g      ð?g      @(*   R!   R"   R#   R   R  R)   Rw   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  Rx   R  R~   R  R  R  R  R  R  R  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR¿   ¢  sT   								
																											t	   TimerBasec           B  s¿   e  Z d  Z d d d „ Z d „  Z d d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z e e
 e ƒ Z d	 „  Z e d
 „ Z e e e ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sv  
    A base class for providing timer events, useful for things animations.
    Backends need to implement a few specific methods in order to use their
    own timing mechanisms so that the timer events are integrated into their
    event loops.

    Mandatory functions that must be implemented:

        * `_timer_start`: Contains backend-specific code for starting
          the timer

        * `_timer_stop`: Contains backend-specific code for stopping
          the timer

    Optional overrides:

        * `_timer_set_single_shot`: Code for setting the timer to
          single shot operating mode, if supported by the timer
          object. If not, the `Timer` class itself will store the flag
          and the `_on_timer` method should be overridden to support
          such behavior.

        * `_timer_set_interval`: Code for setting the interval on the
          timer, if there is a method for doing so on the timer
          object.

        * `_on_timer`: This is the internal function that any timer
          object should call, which will handle the task of running
          all callbacks that have been set.

    Attributes:

        * `interval`: The time between timer events in
          milliseconds. Default is 1000 ms.

        * `single_shot`: Boolean flag indicating whether this timer
          should operate as single shot (run once and then
          stop). Defaults to `False`.

        * `callbacks`: Stores list of (func, args) tuples that will be
          called upon timer events. This list can be manipulated
          directly, or the functions `add_callback` and
          `remove_callback` can be used.
    c         C  sY   | d  k r g  |  _ n
 | |  _ | d  k r: d |  _ n	 | |  _ t |  _ d  |  _ d  S(   Niè  (   R   t	   callbackst	   _intervalR   t   _singlet   _timer(   R   t   intervalR  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   Q  s    
		c         C  s   |  j  ƒ  d S(   s1   Need to stop timer and possibly disconnect timer.N(   t   _timer_stop(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   __del__b  s    c         C  s*   | d k	 r |  j | ƒ n  |  j ƒ  d S(   sˆ   
        Start the timer object. `interval` is optional and will be used
        to reset the timer interval first if provided.
        N(   R   t   _set_intervalt   _timer_start(   R   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   startf  s    c         C  s   |  j  ƒ  d S(   s!   
        Stop the timer.
        N(   R!  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   stopo  s    c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR$  u  s    c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR!  x  s    c         C  s   |  j  S(   N(   R  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _get_interval{  s    c         C  s#   t  | ƒ } | |  _ |  j ƒ  d  S(   N(   t   intR  t   _timer_set_interval(   R   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR#  ~  s    	c         C  s   |  j  S(   N(   R  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _get_single_shot‡  s    c         C  s   | |  _  |  j ƒ  d  S(   N(   R  t   _timer_set_single_shot(   R   t   ss(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _set_single_shotŠ  s    	c         O  s   |  j  j | | | f ƒ d S(   s‘   
        Register `func` to be called by timer when the event fires. Any
        additional arguments provided will be passed to `func`.
        N(   R  RB   (   R   t   funct   argst   kwargs(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   add_callback�  s    c         O  st   | s | r( |  j  j | | | f ƒ nH g  |  j  D] } | d ^ q2 } | | k rp |  j  j | j | ƒ ƒ n  d S(   sÖ   
        Remove `func` from list of callbacks. `args` and `kwargs` are optional
        and used to distinguish between copies of the same function registered
        to be called with different arguments.
        i    N(   R  t   removet   popt   index(   R   R.  R/  R0  t   ct   funcs(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   remove_callback—  s
     c         C  s   d S(   s0   Used to set interval on underlying timer object.N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)  ¤  s    c         C  s   d S(   s3   Used to set single shot on underlying timer object.N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR+  ¨  s    c         C  sz   xQ |  j  D]F \ } } } | | | Ž  } | t k r
 |  j  j | | | f ƒ q
 q
 Wt |  j  ƒ d k rv |  j ƒ  n  d S(   sã   
        Runs all function that have been registered as callbacks. Functions
        can return False (or 0) if they should not be called any more. If there
        are no callbacks, the timer is automatically stopped.
        i    N(   R  R   R2  R6   R&  (   R   R.  R/  R0  t   ret(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   _on_timer¬  s     N(   R!   R"   R#   R   R)   R"  R%  R&  R$  R!  R'  R#  t   propertyR   R*  Rœ   R-  t   single_shotR1  R7  R)  R+  R9  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR  $  s$   ,												t   Eventc           B  s   e  Z d  Z d d „ Z RS(   su  
    A matplotlib event.  Attach additional attributes as defined in
    :meth:`FigureCanvasBase.mpl_connect`.  The following attributes
    are defined and shown with their default values

    *name*
        the event name

    *canvas*
        the FigureCanvas instance generating the event

    *guiEvent*
        the GUI event that triggered the matplotlib event


    c         C  s   | |  _  | |  _ | |  _ d  S(   N(   t   namet   canvast   guiEvent(   R   R=  R>  R?  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   Î  s    		N(   R!   R"   R#   R   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR<  ½  s   t	   IdleEventc           B  s   e  Z d  Z RS(   sc   
    An event triggered by the GUI backend when it is idle -- useful
    for passive animation
    (   R!   R"   R#   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR@  Ô  s   t	   DrawEventc           B  s   e  Z d  Z d „  Z RS(   sð   
    An event triggered by a draw operation on the canvas

    In addition to the :class:`Event` attributes, the following event
    attributes are defined:

    *renderer*
        the :class:`RendererBase` instance for the draw event

    c         C  s    t  j |  | | ƒ | |  _ d  S(   N(   R<  R)   R¨   (   R   R=  R>  R¨   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ç  s    (   R!   R"   R#   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRA  Ü  s   
t   ResizeEventc           B  s   e  Z d  Z d „  Z RS(   sû   
    An event triggered by a canvas resize

    In addition to the :class:`Event` attributes, the following event
    attributes are defined:

    *width*
        width of the canvas in pixels

    *height*
        height of the canvas in pixels

    c         C  s/   t  j |  | | ƒ | j ƒ  \ |  _ |  _ d  S(   N(   R<  R)   R²   t   widthR¡   (   R   R=  R>  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ú  s    (   R!   R"   R#   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRB  ì  s   t
   CloseEventc           B  s   e  Z d  Z d d „ Z RS(   s˜   
    An event triggered by a figure being closed

    In addition to the :class:`Event` attributes, the following event
    attributes are defined:
    c         C  s   t  j |  | | | ƒ d  S(   N(   R<  R)   (   R   R=  R>  R?  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)     s    N(   R!   R"   R#   R   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRD  ÿ  s   t   LocationEventc           B  sG   e  Z d  Z d Z d Z d Z d Z d Z d Z	 d d „ Z
 d „  Z RS(   s%  
    An event that has a screen location

    The following additional attributes are defined and shown with
    their default values.

    In addition to the :class:`Event` attributes, the following
    event attributes are defined:

    *x*
        x position - pixels from left of canvas

    *y*
        y position - pixels from bottom of canvas

    *inaxes*
        the :class:`~matplotlib.axes.Axes` instance if mouse is over axes

    *xdata*
        x coord of mouse in data coords

    *ydata*
        y coord of mouse in data coords

    c         C  s”  t  j |  | | d | ƒ| |  _ | |  _ | d k sC | d k rZ d |  _ |  j ƒ  d S|  j j d k r£ g  |  j j	 j
 ƒ  D] } | j |  ƒ r | ^ q } n |  j j g } t | ƒ d k rÛ d |  _ |  j ƒ  d St | ƒ d k r| j d d „  ƒ | d |  _ n | d |  _ y1 |  j j j ƒ  } | j | | f ƒ \ }	 }
 Wn# t k
 rsd |  _ d |  _ n X|	 |  _ |
 |  _ |  j ƒ  d S(   s?   
        *x*, *y* in figure coords, 0,0 = bottom, left
        R?  Ni    i   t   keyc         S  s   |  j  S(   N(   t   zorder(   R>   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   <lambda>G  s    iÿÿÿÿ(   R<  R)   R>   R?   R   t   inaxest   _update_enter_leaveR>  t   mouse_grabbert   figuret   get_axest   in_axesR6   t   sortt	   transDatat   invertedRy   Rð   t   xdatat   ydata(   R   R=  R>  R>   R?   R?  t   at	   axes_listR;   RR  RS  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   -  s8    			
	
			c         C  sÃ   t  j d k	 rŽ t  j } | j |  j k r¶ y, | j d k	 rU | j j j d | ƒ n  Wn n X|  j d k	 r‹ |  j j j d |  ƒ q‹ q¶ n( |  j d k	 r¶ |  j j j d |  ƒ n  |  t  _ d S(   s*   process the figure/axes enter leave eventst   axes_leave_eventt   axes_enter_eventN(   RE  t	   lasteventR   RI  R>  R  t   process(   R   t   last(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRJ  X  s    	N(   R!   R"   R#   R   R>   R?   RI  RR  RS  RX  R)   RJ  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRE  
  s   +t
   MouseEventc           B  s_   e  Z d  Z d Z d Z d Z d Z d Z d Z	 d Z
 d Z d d d e d d „ Z d „  Z RS(   s  
    A mouse event ('button_press_event',
                   'button_release_event',
                   'scroll_event',
                   'motion_notify_event').

    In addition to the :class:`Event` and :class:`LocationEvent`
    attributes, the following attributes are defined:

    *button*
        button pressed None, 1, 2, 3, 'up', 'down' (up and down are used
        for scroll events)

    *key*
        the key depressed when the mouse event triggered (see
        :class:`KeyEvent`)

    *step*
        number of scroll steps (positive for 'up', negative for 'down')


    Example usage::

        def on_press(event):
            print('you pressed', event.button, event.xdata, event.ydata)

        cid = fig.canvas.mpl_connect('button_press_event', on_press)

    i    c
   
      C  sG   t  j |  | | | | d |	 ƒ| |  _ | |  _ | |  _ | |  _ d S(   sn   
        x, y in figure coords, 0,0 = bottom, left
        button pressed None, 1, 2, 3, 'up', 'down'
        R?  N(   RE  R)   t   buttonRF  t   stept   dblclick(
   R   R=  R>  R>   R?   R\  RF  R]  R^  R?  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   š  s
    			c         C  s6   d d |  j  |  j |  j |  j |  j |  j |  j f S(   Ns4   MPL MouseEvent: xy=(%d,%d) xydata=(%s,%s) button=%d s   dblclick=%s inaxes=%s(   R>   R?   RR  RS  R\  R^  RI  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   __str__¦  s    N(   R!   R"   R#   R   R>   R?   R\  R^  RI  RR  RS  R]  R   R)   R_  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR[  s  s   t	   PickEventc           B  s   e  Z d  Z d d „ Z RS(   sx  
    a pick event, fired when the user picks a location on the canvas
    sufficiently close to an artist.

    Attrs: all the :class:`Event` attributes plus

    *mouseevent*
        the :class:`MouseEvent` that generated the pick

    *artist*
        the :class:`~matplotlib.artist.Artist` picked

    other
        extra class dependent attrs -- eg a
        :class:`~matplotlib.lines.Line2D` pick may define different
        extra attributes than a
        :class:`~matplotlib.collections.PatchCollection` pick event


    Example usage::

        line, = ax.plot(rand(100), 'o', picker=5)  # 5 points tolerance

        def on_pick(event):
            thisline = event.artist
            xdata, ydata = thisline.get_data()
            ind = event.ind
            print('on pick line:', zip(xdata[ind], ydata[ind]))

        cid = fig.canvas.mpl_connect('pick_event', on_pick)

    c         K  s<   t  j |  | | | ƒ | |  _ | |  _ |  j j | ƒ d  S(   N(   R<  R)   t
   mouseeventt   artistt   __dict__t   update(   R   R=  R>  Ra  Rb  R?  R0  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   Î  s    		N(   R!   R"   R#   R   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR`  ­  s    t   KeyEventc           B  s    e  Z d  Z d d d d „ Z RS(   sè  
    A key event (key press, key release).

    Attach additional attributes as defined in
    :meth:`FigureCanvasBase.mpl_connect`.

    In addition to the :class:`Event` and :class:`LocationEvent`
    attributes, the following attributes are defined:

    *key*
        the key(s) pressed. Could be **None**, a single case sensitive ascii
        character ("g", "G", "#", etc.), a special key
        ("control", "shift", "f1", "up", etc.) or a
        combination of the above (e.g., "ctrl+alt+g", "ctrl+alt+G").

    .. note::

        Modifier keys will be prefixed to the pressed key and will be in the
        order "ctrl", "alt", "super". The exception to this rule is when the
        pressed key is itself a modifier key, therefore "ctrl+alt" and
        "alt+control" can both be valid key values.


    Example usage::

        def on_key(event):
            print('you pressed', event.key, event.xdata, event.ydata)

        cid = fig.canvas.mpl_connect('key_press_event', on_key)

    i    c         C  s,   t  j |  | | | | d | ƒ| |  _ d  S(   NR?  (   RE  R)   RF  (   R   R=  R>  RF  R>   R?   R?  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ö  s    N(   R!   R"   R#   R   R)   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRe  Ö  s   t   FigureCanvasBasec           B  së  e  Z d  Z d d d d d d d d d	 d
 d d d d d g Z e Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d^ d „ Z d „  Z d „  Z d „  Z d^ d „ Z d^ d „ Z d^ d „ Z d „  Z d^ d „ Z e d^ d „ Z d^ d „ Z d^ d  „ Z d^ d! „ Z d^ d^ d" „ Z d^ d# „ Z d$ „  Z d% „  Z d& „  Z d' „  Z d( „  Z  d) „  Z! i	 d* d+ 6d, d- 6d. d/ 6d0 d1 6d2 d3 6d4 d5 6d4 d6 6d7 d8 6d7 d9 6Z" d: „  Z# d; „  Z$ d< „  Z% d= „  Z& d> „  Z' d? „  Z( e( Z) Z* d@ „  Z+ dA „  Z, e- r>dB e" dC <e" dC e" dD <dE „  Z. e. Z/ dF e" dG <e" dH <dI „  Z0 e0 Z1 n  dJ „  Z2 dK „  Z3 dL „  Z4 d^ dM dM dN d^ dO „ Z5 dP „  Z6 dQ „  Z7 dR „  Z8 dS „  Z9 dT „  Z: dU „  Z; dV „  Z< dW „  Z= dX „  Z> dY „  Z? dZ „  Z@ d[ d\ „ ZA d] „  ZB RS(_   s’   
    The canvas the figure renders into.

    Public attributes

        *figure*
            A :class:`matplotlib.figure.Figure` instance

      t   resize_eventt
   draw_eventt   key_press_eventt   key_release_eventt   button_press_eventt   button_release_eventt   scroll_eventt   motion_notify_eventt
   pick_eventt
   idle_eventt   figure_enter_eventt   figure_leave_eventRW  RV  t   close_eventc         C  sÃ   | j  |  ƒ | |  _ t j ƒ  |  _ t j ƒ  |  _ d  |  _	 d  |  _
 d \ |  _ |  _ |  j d |  j ƒ |  _ |  j d |  j ƒ |  _ d  |  _ d  |  _ t |  _ t r¿ |  j d |  j ƒ n  d  S(   NRk  Rm  Rn  (   NN(   t
   set_canvasRL  RÀ   t   CallbackRegistryR  t   widgetst   LockDrawt
   widgetlockR   t   _buttont   _keyt   _lastxt   _lastyt   mpl_connectt   pickt   button_pick_idt   scroll_pick_idRK  t   toolbarR   t
   _is_savingt   onHilite(   R   RL  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)     s    						c         C  s   |  j  S(   s�   
        Returns `True` when the renderer is in the process of saving
        to a file, rather than rendering for an on-screen buffer.
        (   R‚  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   is_saving.  s    c         C  sž   d „  } | |  j  j | ƒ ƒ } d } | r: | d } n  x] | r™ | j ƒ  r] |  j ƒ  Pn  d } x* | D]" } | | j ƒ  k rj | } Pqj qj W| } q= Wd S(   sÜ   
        Mouse event processor which removes the top artist
        under the cursor.  Connect this to the 'mouse_press_event'
        using::

            canvas.mpl_connect('mouse_press_event',canvas.onRemove)
        c         S  sI   g  |  D] } | j  | f ^ q } | j ƒ  g  | D] \ } } | ^ q3 S(   N(   RG  RO  (   t   artistsR·   t   LRG  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   sort_artists=  s    "
iÿÿÿÿN(   RL  t   hitlistR   R2  t	   draw_idlet   get_children(   R   t   evR‡  t   underR·   t   parentt   p(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   onRemove5  s    		
c         C  sî  t  |  d ƒ s t ƒ  |  _ n  |  j j | ƒ } g  | D] } | |  j k r7 | ^ q7 } g  |  j D] } | | k rb | ^ qb } x€ | D]x } t  | d ƒ r³ | j |  j | ƒ nB t  | d ƒ rõ | j |  j | d ƒ | j |  j | d ƒ n  |  j | =q‡ Wxq | D]i } t  | d ƒ r5| j ƒ  |  j | <q
t  | d ƒ rf| j	 ƒ  | j
 ƒ  f |  j | <q
d |  j | <q
Wxf | D]^ } t  | d ƒ r£| j d ƒ q~t  | d ƒ rÏ| j d ƒ | j d ƒ q~d |  j | <q~W|  j ƒ  d S(	   sà   
        Mouse event processor which highlights the artists
        under the cursor.  Connect this to the 'motion_notify_event'
        using::

            canvas.mpl_connect('motion_notify_event',canvas.onHilite)
        t   _activet	   get_colort   get_edgecolori    i   t   redt	   lightblueN(   t   hasattrt   dictR�  RL  Rˆ  t	   set_colort   set_edgecolort   set_facecolorR‘  R’  t   get_facecolorR   R‰  (   R   R‹  RŒ  RT  t   entert   leave(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRƒ  W  s4    (("c         C  s&   |  j  j ƒ  s" |  j j | ƒ n  d  S(   N(   Rx  t   lockedRL  R~  (   R   Ra  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR~  …  s    c         C  s   d S(   sA   
        blit the canvas in bbox (default entire canvas)
        N(    (   R   t   bbox(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   blit‰  s    c         C  s   d S(   s/   
        set the canvas size in pixels
        N(    (   R   R¶   R·   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   resize�  s    c         C  s/   d } t  | |  | ƒ } |  j j | | ƒ d S(   sx   
        This method will be call all functions connected to the
        'draw_event' with a :class:`DrawEvent`
        Rh  N(   RA  R  RY  (   R   R¨   R*   t   event(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRh  •  s    c         C  s,   d } t  | |  ƒ } |  j j | | ƒ d S(   s|   
        This method will be call all functions connected to the
        'resize_event' with a :class:`ResizeEvent`
        Rg  N(   RB  R  RY  (   R   R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRg  Ÿ  s    c         C  sP   d } y, t  | |  d | ƒ} |  j j | | ƒ Wn t t f k
 rK n Xd S(   s   
        This method will be called by all functions connected to the
        'close_event' with a :class:`CloseEvent`
        Rs  R?  N(   RD  R  RY  t	   TypeErrorR   (   R   R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRs  ©  s    c         C  sJ   | |  _  d } t | |  | |  j |  j d | ƒ} |  j j | | ƒ d S(   s|   
        This method will be call all functions connected to the
        'key_press_event' with a :class:`KeyEvent`
        Ri  R?  N(   Rz  Re  R{  R|  R  RY  (   R   RF  R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRi  º  s
    	!c         C  sJ   d } t  | |  | |  j |  j d | ƒ} |  j j | | ƒ d |  _ d S(   s~   
        This method will be call all functions connected to the
        'key_release_event' with a :class:`KeyEvent`
        Rj  R?  N(   Re  R{  R|  R  RY  R   Rz  (   R   RF  R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRj  Å  s
    !c         K  s5   d } t  | |  | | | � } |  j j | | ƒ d S(   s’   
        This method will be called by artists who are picked and will
        fire off :class:`PickEvent` callbacks registered listeners
        Ro  N(   R`  R  RY  (   R   Ra  Rb  R0  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRo  Ð  s    c         C  sk   | d k r d |  _  n	 d |  _  d } t | |  | | |  j  |  j d | d | ƒ} |  j j | | ƒ d S(   sI  
        Backend derived classes should call this function on any
        scroll wheel event.  x,y are the canvas coords: 0,0 is lower,
        left.  button and key are as defined in MouseEvent.

        This method will be call all functions connected to the
        'scroll_event' with a :class:`MouseEvent` instance.
        i    t   upt   downRm  R]  R?  N(   Ry  R[  Rz  R  RY  (   R   R>   R?   R]  R?  R*   Ra  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRm  Ù  s    		c         C  sP   | |  _  d } t | |  | | | |  j d | d | ƒ} |  j j | | ƒ d S(   sX  
        Backend derived classes should call this function on any mouse
        button press.  x,y are the canvas coords: 0,0 is lower, left.
        button and key are as defined in :class:`MouseEvent`.

        This method will be call all functions connected to the
        'button_press_event' with a :class:`MouseEvent` instance.

        Rk  R^  R?  N(   Ry  R[  Rz  R  RY  (   R   R>   R?   R\  R^  R?  R*   Ra  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRk  ë  s
    
	c      	   C  sJ   d } t  | |  | | | |  j d | ƒ} |  j j | | ƒ d |  _ d S(   s¼  
        Backend derived classes should call this function on any mouse
        button release.

        *x*
            the canvas coordinates where 0=left

        *y*
            the canvas coordinates where 0=bottom

        *guiEvent*
            the native UI event that generated the mpl event


        This method will be call all functions connected to the
        'button_release_event' with a :class:`MouseEvent` instance.

        Rl  R?  N(   R[  Rz  R  RY  R   Ry  (   R   R>   R?   R\  R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRl  û  s    $c      	   C  sW   | | |  _  |  _ d } t | |  | | |  j |  j d | ƒ} |  j j | | ƒ d S(   sº  
        Backend derived classes should call this function on any
        motion-notify-event.

        *x*
            the canvas coordinates where 0=left

        *y*
            the canvas coordinates where 0=bottom

        *guiEvent*
            the native UI event that generated the mpl event


        This method will be call all functions connected to the
        'motion_notify_event' with a :class:`MouseEvent` instance.

        Rn  R?  N(   R{  R|  R[  Ry  Rz  R  RY  (   R   R>   R?   R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRn    s
    	c         C  s5   |  j  j d t j ƒ d t _ d \ |  _ |  _ d S(   s±   
        Backend derived classes should call this function when leaving
        canvas

        *guiEvent*
            the native UI event that generated the mpl event

        Rr  N(   NN(   R  RY  RE  RX  R   R{  R|  (   R   R?  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   leave_notify_event,  s    
	c         C  sW   | d k	 r. | \ } } | | |  _ |  _ n  t d |  | ƒ } |  j j d | ƒ d S(   s  
        Backend derived classes should call this function when entering
        canvas

        *guiEvent*
            the native UI event that generated the mpl event
        *xy*
            the coordinate location of the pointer when the canvas is
            entered

        Rq  N(   R   R{  R|  R<  R  RY  (   R   R?  t   xyR>   R?   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   enter_notify_event:  s
    c         C  s2   d } t  | |  d | ƒ} |  j j | | ƒ d S(   s   Called when GUI is idle.Rp  R?  N(   R@  R  RY  (   R   R?  R*   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRp  M  s    c         C  s1   |  j  d | f k r$ t d ƒ ‚ n  | |  _  d S(   sâ   
        Set the child axes which are currently grabbing the mouse events.
        Usually called by the widgets themselves.
        It is an error to call this if the mouse is already grabbed by
        another axes.
        s+   two different attempted to grab mouse inputN(   RK  R   t   RuntimeError(   R   t   ax(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   grab_mouseS  s    c         C  s   |  j  | k r d |  _  n  d S(   sÁ   
        Release the mouse grab held by the axes, ax.
        Usually called by the widgets.
        It is ok to call this even if you ax doesn't have the mouse
        grab currently.
        N(   RK  R   (   R   R©  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   release_mouse^  s    c         O  s   d S(   s?   
        Render the :class:`~matplotlib.figure.Figure`
        N(    (   R   R/  R0  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   drawh  s    c         O  s   |  j  | | Ž  d S(   sX   
        :meth:`draw` only if idle; defaults to draw but backends can overrride
        N(   R¬  (   R   R/  R0  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR‰  n  s    c         C  s   d S(   sƒ   
        Draw a cursor in the event.axes if inaxes is not None.  Use
        native GUI drawing for efficiency if possible
        N(    (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_cursort  s    c         C  s(   t  |  j j j ƒ t  |  j j j ƒ f S(   s‚   
        Return the figure width and height in points or pixels
        (depending on the backend), truncated to integers
        (   R(  RL  Rž  RC  R¡   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR²   {  s    s   Encapsulated Postscriptt   epss   Portable Document Formatt   pdfs   LaTeX PGF Figuret   pgfs   Portable Network Graphicst   pngt
   Postscriptt   pss   Raw RGBA bitmapt   rawt   rgbas   Scalable Vector Graphicst   svgt   svgzc         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   t   FigureCanvasPS(   t   backends.backend_psR¸  t   switch_backendst	   print_eps(   R   R/  R0  R¸  R³  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR»  ˜  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   t   FigureCanvasPdf(   t   backends.backend_pdfR¼  Rº  t	   print_pdf(   R   R/  R0  R¼  R¯  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR¾  �  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   t   FigureCanvasPgf(   t   backends.backend_pgfR¿  Rº  t	   print_pgf(   R   R/  R0  R¿  R°  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÁ  ¢  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   t   FigureCanvasAgg(   t   backends.backend_aggRÂ  Rº  t	   print_png(   R   R/  R0  RÂ  t   agg(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÄ  §  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   R¸  (   R¹  R¸  Rº  t   print_ps(   R   R/  R0  R¸  R³  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÆ  ¬  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   RÂ  (   RÃ  RÂ  Rº  t	   print_raw(   R   R/  R0  RÂ  RÅ  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÇ  ±  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   t   FigureCanvasSVG(   t   backends.backend_svgRÈ  Rº  t	   print_svg(   R   R/  R0  RÈ  R¶  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRÊ  ·  s    c         O  s/   d d l  m } |  j | ƒ } | j | | Ž  S(   Niÿÿÿÿ(   RÈ  (   RÉ  RÈ  Rº  t
   print_svgz(   R   R/  R0  RÈ  R¶  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRË  ¼  s    s    Joint Photographic Experts Groupt   jpgt   jpegc   
      O  s¶   d d l  m } |  j | ƒ } | j ƒ  \ } } | j d t ƒ rG d St j d | | d d d d ƒ } t j	 | d	 d
 d g ƒ }	 d	 |	 k r  t
 d |	 d	 <n  | j | d d |	 �S(   s«  
            Supported kwargs:

            *quality*: The image quality, on a scale from 1 (worst) to
                95 (best). The default is 95, if not given in the
                matplotlibrc file in the savefig.jpeg_quality parameter.
                Values above 95 should be avoided; 100 completely
                disables the JPEG quantization stage.

            *optimize*: If present, indicates that the encoder should
                make an extra pass over the image in order to select
                optimal encoder settings.

            *progressive*: If present, indicates that this image
                should be stored as a progressive JPEG file.
            iÿÿÿÿ(   RÂ  t   dryrunNt   RGBAR´  i    i   t   qualityt   optimizet   progressives   savefig.jpeg_qualityR   RÍ  (   RÃ  RÂ  Rº  t   print_to_bufferR3  R   R   t
   frombufferRÀ   t   restrict_dictR   t   save(
   R   t   filename_or_objR/  R0  RÂ  RÅ  t   bufR´   t   imaget   options(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   print_jpgÅ  s    !s   Tagged Image File Formatt   tift   tiffc   
      O  s™   d d l  m } |  j | ƒ } | j ƒ  \ } } | j d t ƒ rG d  St j d | | d d d d ƒ } |  j j	 |  j j	 f }	 | j
 | d d	 d
 |	 ƒS(   Niÿÿÿÿ(   RÂ  RÎ  RÏ  R´  i    i   R   RÝ  R¹   (   RÃ  RÂ  Rº  RÓ  R3  R   R   RÔ  RL  R¹   RÖ  (
   R   R×  R/  R0  RÂ  RÅ  RØ  R´   RÙ  R¹   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   print_tifç  s    !c         C  s   |  j  S(   s=   Return dict of savefig file formats supported by this backend(   t	   filetypes(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_supported_filetypesó  s    c         C  sQ   i  } xD |  j  j ƒ  D]3 \ } } | j | g  ƒ j | ƒ | | j ƒ  q W| S(   s  Return a dict of savefig file formats supported by this backend,
        where the keys are a file type name, such as 'Joint Photographic
        Experts Group', and the values are a list of filename extensions used
        for that filetype, such as ['jpg', 'jpeg'].(   Rß  t	   iteritemst
   setdefaultRB   RO  (   R   t	   groupingst   extR=  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_supported_filetypes_grouped÷  s
    c           sœ   d | ‰ | t  k r9 t  | ‰  ‡  ‡ ‡ f d †  } | Sˆ j ƒ  } | | k sa t ˆ ˆ ƒ r� t | ƒ } t d | d j | ƒ f ƒ ‚ n  t ˆ ˆ ƒ S(   Ns   print_%sc            s+   ˆ j  ˆ  ƒ } t | ˆ ƒ } | |  | Ž  S(   N(   Rº  t   getattr(   R/  R0  t   backendt   print_method(   R   t   method_nameR   (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _print_method	  s    s4   Format "%s" is not supported.
Supported formats: %s.s   , (   R   Rà  R•  t   sortedRð   t   joinRæ  (   R   R   Rê  t   formats(    (   R   Ré  R   sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   _get_print_method  s    

R¶   t   portraitc         K  s  | d k r‹ t j | ƒ r8 t j j | ƒ d d } n  | d k sP | d k r‹ |  j ƒ  } t j | ƒ rˆ | j d ƒ d | } qˆ q‹ n  | j ƒ  } |  j	 | ƒ } | d k r¿ t
 d } n  |  j j }	 |  j j ƒ  }
 |  j j ƒ  } | |  j _ |  j j | ƒ |  j j | ƒ | j d d ƒ } | d k r@t
 d } n  | rv| d k rO| t j ƒ  d | d	 | d
 | d | d t | �} |  j j } |  j j | ƒ } | j d d ƒ } | d k rÓ|  j j ƒ  } n  g  } xÞ | D]Ö } | j | ƒ } | j ƒ  r|| j ƒ  } | d k	 r.t j | | ƒ } n  | j ƒ  } | d k	 r|| d k	 r|| j ƒ  } t j | | j ƒ  ƒ } q|n  | d k	 rà| j  d k s¦| j! d k rà| j" | ƒ qàqàW| rt j# | ƒ } t$ ƒ  j% d |  j j ƒ } t& | | ƒ } t j# | | g ƒ } n  | j d d ƒ } | d k r=t
 d } n  | j' | ƒ } n  t( j) |  j | | ƒ } | | f } n d } t |  _* z1 | | d | d	 | d
 | d | d | | �} Wd | rÏ| rÏ| ƒ  n  |	 |  j _ |  j j |
 ƒ |  j j | ƒ |  j j+ |  ƒ t, |  _* X| S(   s  
        Render the figure to hardcopy. Set the figure patch face and edge
        colors.  This is useful because some of the GUIs have a gray figure
        face color background and you'll probably want to override this on
        hardcopy.

        Arguments are:

        *filename*
            can also be a file object on image backends

        *orientation*
            only currently applies to PostScript printing.

        *dpi*
            the dots per inch to save the figure in; if None, use savefig.dpi

        *facecolor*
            the facecolor of the figure

        *edgecolor*
            the edgecolor of the figure

        *orientation*
            landscape' | 'portrait' (not supported on all backends)

        *format*
            when set, forcibly set the file format to save to

        *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. If None, use savefig.bbox

        *pad_inches*
            Amount of padding around the figure when bbox_inches is
            'tight'. If None, use savefig.pad_inches

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

        i   t    t   .s   savefig.dpit   bbox_inchess   savefig.bboxt   tightR¹   t	   facecolort	   edgecolort   orientationRÎ  t   bbox_extra_artistsi    g      ð?t
   pad_inchess   savefig.pad_inchest   bbox_inches_restoreN(-   R   RÀ   t   is_string_liket   osR0   t   splitextt   get_default_filetypet   rstript   lowerRî  R   RL  R¹   Rš  R’  R™  R˜  R3  t   iot   BytesIORœ   t   _cachedRenderert   get_tightbboxt   get_default_bbox_extra_artistst   get_window_extentt   get_clip_ont   get_clip_boxR   t   intersectionRã   t   get_fully_transformed_patht   get_extentsRC  R¡   RB   t   unionR   Rž   R   t   paddedt
   tight_bboxt   adjust_bboxR‚  Rt  R   (   R   t   filenameR¹   Rô  Rõ  Rö  R   R0  Rè  t   origDPIt   origfacecolort   origedgecolorRò  t   resultR¨   t   bbox_artistst   bbox_filteredRT  Rž  t   clip_boxt	   clip_patht   _bboxR;   t
   bbox_extrat   padt   restore_bboxt   _bbox_inches_restore(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   print_figure  s¢    - 				

c         C  s   t  d S(   sÏ   
        Get the default savefig file format as specified in rcParam
        ``savefig.format``. Returned string excludes period. Overridden
        in backends that only support a single file type.
        s   savefig.format(   R   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRý  ¹  s    c         C  s    t  |  d ƒ r |  j j ƒ  Sd S(   s‡   
        Get the title text of the window containing the figure.
        Return None if there is no window (eg, a PS backend).
        R   N(   R•  R   t   get_window_title(   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR  Á  s    c         C  s&   t  |  d ƒ r" |  j j | ƒ n  d S(   s™   
        Set the title text of the window containing the figure.  Note that
        this has no effect if there is no window (eg, a PS backend).
        R   N(   R•  R   t   set_window_title(   R   t   title(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR  É  s    c         C  s<   |  j  ƒ  p d } | j ƒ  j d d ƒ } | d |  j ƒ  S(   sl   
        Return a string, which includes extension, suitable for use as
        a default filename.
        RÙ  t    t   _Rñ  (   R  Rÿ  t   replaceRý  (   R   t   default_filename(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   get_default_filenameÑ  s    c         C  s   | |  j  ƒ } |  j | _ | S(   sO  
        Instantiate an instance of FigureCanvasClass

        This is used for backend switching, eg, to instantiate a
        FigureCanvasPS from a FigureCanvasGTK.  Note, deep copying is
        not done, so any changes to one of the instances (eg, setting
        figure size or line props), will be reflected in the other
        (   RL  R‚  (   R   t   FigureCanvasClasst	   newCanvas(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRº  Ú  s    	c         C  s   |  j  j | | ƒ S(   s´  
        Connect event with string *s* to *func*.  The signature of *func* is::

          def func(event)

        where event is a :class:`matplotlib.backend_bases.Event`.  The
        following events are recognized

        - 'button_press_event'
        - 'button_release_event'
        - 'draw_event'
        - 'key_press_event'
        - 'key_release_event'
        - 'motion_notify_event'
        - 'pick_event'
        - 'resize_event'
        - 'scroll_event'
        - 'figure_enter_event',
        - 'figure_leave_event',
        - 'axes_enter_event',
        - 'axes_leave_event'
        - 'close_event'

        For the location events (button and key press/release), if the
        mouse is over the axes, the variable ``event.inaxes`` will be
        set to the :class:`~matplotlib.axes.Axes` the event occurs is
        over, and additionally, the variables ``event.xdata`` and
        ``event.ydata`` will be defined.  This is the mouse location
        in data coords.  See
        :class:`~matplotlib.backend_bases.KeyEvent` and
        :class:`~matplotlib.backend_bases.MouseEvent` for more info.

        Return value is a connection id that can be used with
        :meth:`~matplotlib.backend_bases.Event.mpl_disconnect`.

        Example usage::

            def on_press(event):
                print('you pressed', event.button, event.xdata, event.ydata)

            cid = canvas.mpl_connect('button_press_event', on_press)

        (   R  t   connect(   R   R*   R.  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR}  ç  s    -c         C  s   |  j  j | ƒ S(   sÈ   
        Disconnect callback id cid

        Example usage::

            cid = canvas.mpl_connect('button_press_event', on_press)
            #...later
            canvas.mpl_disconnect(cid)
        (   R  t
   disconnect(   R   t   cid(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   mpl_disconnect	  s    
c         O  s   t  | | Ž  S(   sÞ  
        Creates a new backend-specific subclass of
        :class:`backend_bases.Timer`. This is useful for getting periodic
        events through the backend's native event loop. Implemented only for
        backends with GUIs.

        optional arguments:

        *interval*
          Timer interval in milliseconds
        *callbacks*
          Sequence of (func, args, kwargs) where func(*args, **kwargs) will
          be executed by the timer every *interval*.
        (   R  (   R   R/  R0  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt	   new_timer"	  s    c         C  s
   t  ‚ d S(   sg   
        Flush the GUI events for the figure. Implemented only for
        backends with GUIs.
        N(   R.   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   flush_events3	  s    c         C  s
   t  ‚ d S(   s|  
        Start an event loop.  This is used to start a blocking event
        loop so that interactive functions, such as ginput and
        waitforbuttonpress, can wait for events.  This should not be
        confused with the main GUI event loop, which is always running
        and has nothing to do with this.

        This is implemented only for backends with GUIs.
        N(   R.   (   R   t   timeout(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   start_event_loop:	  s    
c         C  s
   t  ‚ d S(   sö   
        Stop an event loop.  This is used to stop a blocking event
        loop so that interactive functions, such as ginput and
        waitforbuttonpress, can wait for events.

        This is implemented only for backends with GUIs.
        N(   R.   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   stop_event_loopF	  s    i    c         C  s’   d } | d 7} t  j | t ƒ | d k r8 t j } n  d } d } t |  _ x> |  j r� | | | k  r� |  j ƒ  t j	 | ƒ | d 7} qP Wd S(   s'  
        Start an event loop.  This is used to start a blocking event
        loop so that interactive functions, such as ginput and
        waitforbuttonpress, can wait for events.  This should not be
        confused with the main GUI event loop, which is always running
        and has nothing to do with this.

        This function provides default event loop functionality based
        on time.sleep that is meant to be used until event loop
        functions for each of the GUI backends can be written.  As
        such, it throws a deprecated warning.

        Call signature::

            start_event_loop_default(self,timeout=0)

        This call blocks until a callback function triggers
        stop_event_loop() or *timeout* is reached.  If *timeout* is
        <=0, never timeout.
        s0   Using default event loop until function specifics    to this GUI is implementedi    g{®Gáz„?i   N(
   t   warningst   warnR
   R[   t   infRœ   t   _loopingR-  t   timet   sleep(   R   R.  R	  t   timestept   counter(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   start_event_loop_defaultP	  s    
	
c         C  s   t  |  _ d S(   sÿ   
        Stop an event loop.  This is used to stop a blocking event
        loop so that interactive functions, such as ginput and
        waitforbuttonpress, can wait for events.

        Call signature::

          stop_event_loop_default(self)
        N(   R   R4  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   stop_event_loop_defaults	  s    
N(C   R!   R"   R#   t   eventsRœ   t   supports_blitR)   R„  R�  Rƒ  R~  R   RŸ  R   Rh  Rg  Rs  Ri  Rj  Ro  Rm  R   Rk  Rl  Rn  R¥  R§  Rp  Rª  R«  R¬  R‰  R­  R²   Rß  R»  R¾  RÁ  RÄ  RÆ  RÇ  t	   print_bmpt
   print_rgbaRÊ  RË  t   _has_pilRÛ  t
   print_jpegRÞ  t
   print_tiffRà  Rå  Rî  R  Rý  R  R  R%  Rº  R}  R+  R,  R-  R/  R0  R9  R:  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRf  û  s°   					"	.			
	
				
				
						
		
		
					ž							/					
#c         C  sž  |  j  d k r d St d } t d } t d } t d } t d } t d } t d }	 t d	 }
 t d
 } t d } t d } t d } |  j  | k rª | j j ƒ  n  |  j  |
 k rÌ t j | j ƒ n  | d k	 rƒ|  j  | k rô | j ƒ  qƒ|  j  | k r| j	 ƒ  qƒ|  j  | k r,| j
 ƒ  qƒ|  j  | k rH| j ƒ  qƒ|  j  | k rd| j ƒ  qƒ|  j  |	 k rƒ| j ƒ  qƒn  |  j d k r–d S|  j  | k r¿|  j j ƒ  | j ƒ  nÛ|  j  | k r>|  j } | j ƒ  } | d k r| j d ƒ | j j j ƒ  qš| d k rš| j d ƒ | j j j ƒ  qšn\|  j  | k r½|  j } | j ƒ  } | d k rŽ| j d ƒ | j j j ƒ  qš| d k rš| j d ƒ | j j j ƒ  qšnÝ |  j  j ƒ  rÛ|  j  d k sê|  j  | k rš|  j  | k rt |  j  ƒ d } n  xˆ t | j j ƒ  ƒ D]n \ } } |  j d k	 r%|  j d k	 r%| j |  ƒ r%|  j  | k r}| j t ƒ q“| j | | k ƒ q%q%Wn  d S(   s  
    Implement the default mpl key bindings for the canvas and toolbar
    described at :ref:`key-event-handling`

    *event*
      a :class:`KeyEvent` instance
    *canvas*
      a :class:`FigureCanvasBase` instance
    *toolbar*
      a :class:`NavigationToolbar2` instance

    Ns   keymap.fullscreens   keymap.homes   keymap.backs   keymap.forwards
   keymap.pans   keymap.zooms   keymap.saves   keymap.quits   keymap.grids   keymap.yscales   keymap.xscales   keymap.all_axest   logt   lineart   0i   (   RF  R   R   R   t   full_screen_toggleR   t   destroy_figRL  t   homet   backt   forwardt   pant   zoomt   save_figureRI  t   gridR¬  t
   get_yscalet
   set_yscaleR>  t
   get_xscalet
   set_xscalet   isdigitR(  t	   enumerateRM  R>   R?   RN  t   set_navigateRœ   (   R¡  R>  R�  t   fullscreen_keyst	   home_keyst	   back_keyst   forward_keyst   pan_keyst	   zoom_keyst	   save_keyst	   quit_keyst	   grid_keyst   toggle_yscale_keyst   toggle_xscale_keyst   allR©  Rž   t   scalext   nRt   RT  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   key_press_handler€	  s~    











		-"t   NonGuiExceptionc           B  s   e  Z RS(    (   R!   R"   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRd  ì	  s   t   FigureManagerBasec           B  s_   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   sÅ   
    Helper class for pyplot mode, wraps everything up into a neat bundle

    Public attibutes:

    *canvas*
        A :class:`FigureCanvasBase` instance

    *num*
        The figure number
    c         C  s:   | |  _  |  | _ | |  _ |  j  j d |  j ƒ |  _ d  S(   NRi  (   R>  R   t   numR}  t	   key_presst   key_press_handler_id(   R   R>  Rf  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ü	  s    			
c         C  s   t  ƒ  ‚ d S(   sØ   
        For GUI backends, show the figure window and redraw.
        For non-GUI backends, raise an exception to be caught
        by :meth:`~matplotlib.figure.Figure.show`, for an
        optional warning.
        N(   Rd  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR   
  s    c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   destroy
  s    c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRE  
  s    c         C  s   d S(   s1   "For gui backends, resize the window (in pixels).N(    (   R   R¶   R·   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR   
  s    c         C  s   t  | |  j |  j j ƒ d S(   se   
        Implement the default mpl key bindings defined at
        :ref:`key-event-handling`
        N(   Rc  R>  R�  (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRg  !
  s    c         C  s   d S(   s8   
        Display message in a popup -- GUI only
        N(    (   R   t   msg(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   show_popup(
  s    c         C  s   d S(   s†   
        Get the title text of the window containing the figure.
        Return None for non-GUI backends (eg, a PS backend).
        RÙ  (    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR  .
  s    c         C  s   d S(   s˜   
        Set the title text of the window containing the figure.  Note that
        this has no effect for non-GUI backends (eg, a PS backend).
        N(    (   R   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR  5
  s    (   R!   R"   R#   R)   R   Ri  RE  R   Rg  Rk  R  R  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRe  ð	  s   									t   Cursorsc           B  s    e  Z e d  ƒ \ Z Z Z Z RS(   i   (   R!   R"   t   ranget   HANDt   POINTERt   SELECT_REGIONt   MOVE(    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRl  =
  s   t   NavigationToolbar2c           B  s+  e  Z d  Z d6 d7 d8 d: d; d< d= d> d? f	 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 d* „  Z d+ „  Z d, „  Z d- „  Z d. „  Z d/ „  Z d0 „  Z d1 „  Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z  RS(@   s†  
    Base class for the navigation cursor, version 2

    backends must implement a canvas that handles connections for
    'button_press_event' and 'button_release_event'.  See
    :meth:`FigureCanvasBase.mpl_connect` for more information


    They must also define

      :meth:`save_figure`
         save the current figure

      :meth:`set_cursor`
         if you want the pointer icon to change

      :meth:`_init_toolbar`
         create your toolbar widget

      :meth:`draw_rubberband` (optional)
         draw the zoom to rect "rubberband" rectangle

      :meth:`press`  (optional)
         whenever a mouse button is pressed, you'll be notified with
         the event

      :meth:`release` (optional)
         whenever a mouse button is released, you'll be notified with
         the event

      :meth:`dynamic_update` (optional)
         dynamically update the window while navigating

      :meth:`set_message` (optional)
         display message

      :meth:`set_history_buttons` (optional)
         you can change the history back / forward buttons to
         indicate disabled / enabled state.

    That's it, we'll do the rest!
    t   Homes   Reset original viewRG  t   Backs   Back to  previous viewRH  t   Forwards   Forward to next viewRI  t   Pans)   Pan axes with left mouse, zoom with rightt   moveRJ  t   Zooms   Zoom to rectanglet   zoom_to_rectRK  t   Subplotss   Configure subplotst   subplotst   configure_subplotst   Saves   Save the figuret   filesaveRL  c         C  s´   | |  _  |  | _ t j ƒ  |  _ t j ƒ  |  _ d  |  _ d  |  _ d  |  _	 d  |  _
 d  |  _ |  j ƒ  |  j  j d |  j ƒ |  _ g  |  _ d  |  _ d  |  _ d |  _ |  j ƒ  d  S(   NRn  Rð  (   R>  R�  RÀ   t   Stackt   _viewst
   _positionsR   t   _xypresst   _idPresst
   _idReleaseR�  t   _lastCursort   _init_toolbarR}  t
   mouse_movet   _idDragt	   _ids_zoomt
   _zoom_modet   _button_pressedt   modet   set_history_buttons(   R   R>  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR)   ‚
  s"    							
					c         C  s   d S(   s-   Display a message on toolbar or in status barN(    (   R   R*   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   set_message›
  s    c         G  s2   |  j  j ƒ  |  j j ƒ  |  j ƒ  |  j ƒ  d S(   s   move back up the view lim stackN(   R€  RH  R�  R�  t   _update_view(   R   R/  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRH  Ÿ
  s    
c         C  s   d  S(   N(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   dynamic_update¦
  s    c         C  s   d S(   s3   Draw a rectangle rubberband to indicate zoom limitsN(    (   R   R¡  t   x0t   y0t   x1t   y1(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   draw_rubberband©
  s    c         G  s2   |  j  j ƒ  |  j j ƒ  |  j ƒ  |  j ƒ  d S(   s"   Move forward in the view lim stackN(   R€  RI  R�  R�  R�  (   R   R/  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRI  ­
  s    
c         G  s2   |  j  j ƒ  |  j j ƒ  |  j ƒ  |  j ƒ  d S(   s   Restore the original viewN(   R€  RG  R�  R�  R�  (   R   R/  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRG  ´
  s    
c         C  s
   t  ‚ d S(   s‰  
        This is where you actually build the GUI widgets (called by
        __init__).  The icons ``home.xpm``, ``back.xpm``, ``forward.xpm``,
        ``hand.xpm``, ``zoom_to_rect.xpm`` and ``filesave.xpm`` are standard
        across backends (there are ppm versions in CVS also).

        You just need to set the callbacks

        home         : self.home
        back         : self.back
        forward      : self.forward
        hand         : self.pan
        zoom_to_rect : self.zoom
        filesave     : self.save_figure

        You only need to define the last one - the others are in the base
        class implementation.

        N(   R.   (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR†  »
  s    c         C  sl  | j  s |  j rH |  j t j k rË |  j t j ƒ t j |  _ qË nƒ |  j d k r‹ |  j t j k rË |  j t j ƒ t j |  _ qË n@ |  j d k rË |  j t j k rË |  j t j ƒ t j |  _ n  | j  rX| j  j ƒ  rXy | j  j	 | j
 | j ƒ } Wn t t f k
 rqhXt |  j ƒ rH|  j d |  j | f ƒ qh|  j | ƒ n |  j |  j ƒ d  S(   Nt   ZOOMt   PANs   %s, %s(   RI  R�  R…  t   cursorsRo  t
   set_cursorRp  Rq  t   get_navigatet   format_coordRR  RS  Rð   t   OverflowErrorR6   RŒ  RŽ  (   R   R¡  R*   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR‡  Ñ
  s*    c         G  s9  |  j  d k r d |  _  n	 d |  _  |  j d k	 rW |  j j |  j ƒ |  _ d |  _ n  |  j d k	 rŠ |  j j |  j ƒ |  _ d |  _ n  |  j  rå |  j j d |  j ƒ |  _ |  j j d |  j	 ƒ |  _ d |  _ |  j j
 |  ƒ n |  j j
 j |  ƒ x* |  j j j ƒ  D] } | j |  j  ƒ qW|  j |  j ƒ d S(   sA   Activate the pan/zoom tool. pan with left button, zoom with rightR—  Rð  Rk  Rl  s   pan/zoomN(   R�  R   Rƒ  R>  R+  RŒ  R„  R}  t	   press_pant   release_panRx  t   releaseRL  RM  t   set_navigate_modeRŽ  (   R   R/  RT  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRJ  ï
  s(    					c         C  s   d S(   s)   Called whenver a mouse button is pressed.N(    (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   press  s    c         C  sQ  | j  d k r d |  _ n( | j  d k r6 d |  _ n d |  _ d S| j | j } } |  j j ƒ  rr |  j ƒ  n  g  |  _ xÂ t	 |  j
 j j ƒ  ƒ D]¨ \ } } | d k	 r” | d k	 r” | j | ƒ r” | j ƒ  r” | j ƒ  r” | j | | | j  ƒ |  j j | | f ƒ |  j
 j |  j ƒ |  j
 j d |  j ƒ |  _ q” q” W|  j | ƒ d S(   s0   the press mouse button in pan/zoom mode callbacki   i   NRn  (   R\  R‹  R   R>   R?   R€  t   emptyt   push_currentR‚  RS  R>  RL  RM  RN  Rš  t   can_pant	   start_panRB   R+  Rˆ  R}  t   drag_panR¡  (   R   R¡  R>   R?   Rt   RT  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR�    s&    		%'c   
      C  sú  |  j  g  k ri x! |  j  D] } |  j j | ƒ q W|  j | ƒ |  j ƒ  d |  _ d |  _ g  |  _  d S| j d k r„ d |  _ n( | j d k rŸ d |  _ n d |  _ d S| j	 | j
 } } |  j j ƒ  rÛ |  j ƒ  n  g  |  _ xœ t |  j j j ƒ  ƒ D]‚ \ } } | d k	 rý | d k	 rý | j | ƒ rý | j ƒ  rý | j ƒ  rý |  j j | | | | | j j ƒ  | j j ƒ  f ƒ qý qý W|  j j d |  j ƒ } |  j j d |  j ƒ } |  j j d |  j ƒ }	 | | |	 f |  _  | j |  _ |  j | ƒ d S(   s4   the press mouse button in zoom to rect mode callbackNi   i   Rn  Ri  Rj  (   R‰  R>  R+  RŸ  R¬  R   R‚  R‹  R\  R>   R?   R€  R¢  R£  RS  RL  RM  RN  Rš  t   can_zoomRB   t   viewLimRg   RP  R}  t	   drag_zoomt   _switch_on_zoom_modet   _switch_off_zoom_modeRF  RŠ  R¡  (
   R   R¡  t   zoom_idR>   R?   Rt   RT  t   id1t   id2t   id3(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt
   press_zoom0  s@    
					%'!c         C  s   | j  |  _ |  j | ƒ d  S(   N(   RF  RŠ  R‡  (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRª  ^  s    c         C  s   d  |  _ |  j | ƒ d  S(   N(   R   RŠ  R‡  (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR«  b  s    	c         C  sÂ   g  } g  } x… |  j  j j ƒ  D]q } | j ƒ  \ } } | j ƒ  \ } } | j | | | | f ƒ | j | j t ƒ j ƒ  | j ƒ  j ƒ  f ƒ q W|  j	 j
 | ƒ |  j j
 | ƒ |  j ƒ  d S(   s8   push the current view limits and position onto the stackN(   R>  RL  RM  t   get_xlimt   get_ylimRB   t   get_positionRœ   Rg   R€  t   pushR�  R�  (   R   t   limst   posRT  t   xmint   xmaxt   ymint   ymax(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR£  f  s    c         C  s   d S(   s5   this will be called whenever mouse button is releasedN(    (   R   R¡  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRŸ  v  s    c         C  s©   |  j  d k r d S|  j j |  j ƒ |  j j d |  j ƒ |  _ x! |  j D] \ } } | j ƒ  qK W|  j sr d Sg  |  _ d |  _  |  j	 ƒ  |  j
 | ƒ |  j ƒ  d S(   s2   the release mouse button callback in pan/zoom modeNRn  (   R‹  R   R>  R+  Rˆ  R}  R‡  R‚  t   end_panR£  RŸ  R¬  (   R   R¡  RT  t   ind(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRž  z  s    				
c         C  sJ   x9 |  j  D]. \ } } | j |  j | j | j | j ƒ q
 W|  j ƒ  d S(   s"   the drag callback in pan/zoom modeN(   R‚  R¦  R‹  RF  R>   R?   R�  (   R   R¡  RT  R¼  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR¦  Œ  s    &c         C  sC  |  j  r?| j | j } } |  j  d \ } } } } } }	 | j j \ }
 } } } t t | | ƒ |
 ƒ t t | | ƒ | ƒ } } t t | | ƒ | ƒ t t | | ƒ | ƒ } } |  j d k rì | j j \ }
 } } } | | } } n7 |  j d k r#| j j \ }
 } } } |
 | } } n  |  j | | | | | ƒ n  d S(   s   the drag callback in zoom modei    R>   R?   N(	   R‚  R>   R?   Rž  t   extentsRn   t   minRŠ  R•  (   R   R¡  R>   R?   t   lastxt   lastyRT  R¼  t   limR;   R“  R”  t   x2t   y2(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR©  •  s    	11c         C  s×  x! |  j  D] } |  j j | ƒ q
 Wg  |  _  |  j s: d Sg  } xT|  j D]I} | j | j } } | \ } } }	 }
 } } t | | ƒ d k  s§ t | | ƒ d k  rË d |  _ |  j | ƒ |  j	 ƒ  d S| j
 \ } } } } |	 j j ƒ  } | j | | f ƒ \ } } | j | | f ƒ \ } } |	 j ƒ  \ } } |	 j ƒ  \ } } t t } } | r²xS | D]H } |	 j ƒ  j |	 | ƒ rŠt } n  |	 j ƒ  j |	 | ƒ rct } qcqcWn  | j |	 ƒ | rÕ| | } } nµ | | k  r7| | k  rý| | } } n | | } } | | k  r| } n  | | k rŠ| } qŠnS | | k rS| | } } n | | } } | | k ru| } n  | | k  rŠ| } n  | r | | } } nµ | | k  r| | k  rÈ| | } } n | | } } | | k  rê| } n  | | k rU| } qUnS | | k r| | } } n | | } } | | k r@| } n  | | k  rU| } n  |  j d k r×|  j d k r‰|	 j | | f ƒ q“|  j d k r®|	 j | | f ƒ q“|	 j | | f ƒ |	 j | | f ƒ qJ |  j d k rJ |	 j ƒ  d k rMt j | | ƒ t j | | ƒ } t | | | ƒ | } t | | | ƒ | } n6 | | | | } | | | | } | | | | } |	 j ƒ  d k rêt j | | ƒ t j | | ƒ } t | | | ƒ | } t | | | ƒ | } n6 | | | | } | | | | } | | | | } |  j d k rE|	 j | | f ƒ q“|  j d k rj|	 j | | f ƒ q“|	 j | | f ƒ |	 j | | f ƒ qJ qJ W|  j	 ƒ  d |  _ d |  _ d |  _ |  j ƒ  |  j | ƒ d S(   s6   the release mouse button callback in zoom to rect modeNi   i   R>   R?   i   RB  (    R‰  R>  R+  R‚  R>   R?   t   absR   RŸ  R¬  R½  RP  RQ  Ry   R±  R²  R   t   get_shared_x_axest   joinedRœ   t   get_shared_y_axesRB   R‹  RŠ  t   set_xlimt   set_ylimRP  R[   RB  t   powRN  R£  (   R   R¡  R¬  t   last_at   cur_xypressR>   R?   R¿  RÀ  RT  R¼  RÁ  R;   R‘  R’  R“  R”  t   inverset   Xmint   Xmaxt   Ymint   Ymaxt   twinxt   twinyt   laRì   t   rx1t   rx2t   ry1t   ry2(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   release_zoomª  sÀ    		,	
							$$
			
c         C  sÝ   xÉ |  j  j j ƒ  D]µ } t | d d ƒ } t | d d ƒ } g  } | d k	 rx | j | j ƒ  ƒ | j | j ƒ  ƒ n  | d k	 r­ | j | j ƒ  ƒ | j | j ƒ  ƒ n  x | D] } | j ƒ  q´ Wq W|  j  j	 ƒ  d S(   s(   Redraw the canvases, update the locatorst   xaxist   yaxisN(
   R>  RL  RM  Ræ  R   RB   t   get_major_locatort   get_minor_locatort   refreshR‰  (   R   RT  RÚ  RÛ  t   locatorst   loc(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR¬  )  s    c   	      C  sÞ   |  j  ƒ  } | d k r d S|  j ƒ  } | d k r8 d Sx’ t |  j j j ƒ  ƒ D]x \ } } | | \ } } } } | j | | f ƒ | j | | f ƒ | j	 | | d d ƒ | j	 | | d d ƒ qQ W|  j j
 ƒ  d S(   s_   Update the viewlim and position from the view and
        position stack for each axes
        Ni    t   originali   t   active(   R€  R   R�  RS  R>  RL  RM  RÈ  RÉ  t   set_positionR‰  (	   R   Rµ  R¶  Rt   RT  R·  R¸  R¹  Rº  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR�  :  s    %c         G  s
   t  ‚ d S(   s   Save the current figureN(   R.   (   R   R/  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRL  O  s    c         C  s   d S(   s\   
        Set the current cursor to one of the :class:`Cursors`
        enums values
        N(    (   R   t   cursor(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR™  S  s    c         C  s(   |  j  j ƒ  |  j j ƒ  |  j ƒ  d S(   s   Reset the axes stackN(   R€  t   clearR�  R�  (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRd  Z  s    c         G  s9  |  j  d k r d |  _  n	 d |  _  |  j d k	 rW |  j j |  j ƒ |  _ d |  _ n  |  j d k	 rŠ |  j j |  j ƒ |  _ d |  _ n  |  j  rå |  j j d |  j ƒ |  _ |  j j d |  j	 ƒ |  _ d |  _ |  j j
 |  ƒ n |  j j
 j |  ƒ x* |  j j j ƒ  D] } | j |  j  ƒ qW|  j |  j ƒ d S(   s   Activate zoom to rect modeR–  Rð  Rk  Rl  s	   zoom rectN(   R�  R   Rƒ  R>  R+  RŒ  R„  R}  R°  RÙ  Rx  RŸ  RL  RM  R   RŽ  (   R   R/  RT  (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRK  `  s(    			c         C  s   d S(   s%   Enable or disable back/forward buttonN(    (   R   (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyR�  ~  s    (   Rs  s   Reset original views   homes   home(   Rt  s   Back to  previous views   backs   back(   s   Forwards   Forward to next views   forwards   forwardN(   NNNN(   Rv  s)   Pan axes with left mouse, zoom with rights   moves   pan(   Rx  s   Zoom to rectangleRy  s   zoom(   NNNN(   Rz  s   Configure subplotsR{  R|  (   R}  s   Save the figureR~  s   save_figure(!   R!   R"   R#   R   t	   toolitemsR)   RŽ  RH  R�  R•  RI  RG  R†  R‡  RJ  R¡  R�  R°  Rª  R«  R£  RŸ  Rž  R¦  R©  RÙ  R¬  R�  RL  R™  Rd  RK  R�  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyRr  C
  sL   *
											 			.															(A   R#   t
   __future__R    R   Rû  R1  R5  R   t   numpyR[   t   matplotlib.cbookRÀ   t   matplotlib.colorsRe   t   matplotlib.transformsR7   t   matplotlib.widgetsRv  R   R   R   R   t   matplotlib._pylab_helpersR   R   R   R   t   matplotlib.tight_bboxR  t   matplotlib.textpathR&   t   matplotlib.pathR	   R
   t   PILR   Rœ   R?  t   ImportErrorR   R   R   t   objectR   R$   R¿   R  R<  R@  RA  RB  RD  RE  R[  R`  Re  Rf  R   Rc  t	   ExceptionRd  Re  Rl  R˜  Rr  (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/backend_bases.pyt   <module>   sh   

	8ÿ ÿ )ÿ ƒ™i:)%ÿ ÿ ÿ ˆlM	