ó
±éRc           @   s4  d  Z  d d l j Z d d l m Z d d l Z d e f d „  ƒ  YZ	 d e f d „  ƒ  YZ
 d d l m Z m Z d	 e	 f d
 „  ƒ  YZ d e	 f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d f  d „  ƒ  YZ i  Z d „  Z d „  Z e d d d d d g d „ Z d d l m Z e e ƒ Z d S(   s  
The axes_divider module provide helper classes to adjust the positions of
multiple axes at the drawing time.

 Divider: this is the class that is used calculates the axes
    position. It divides the given rectangular area into several sub
    rectangles. You initialize the divider by setting the horizontal
    and vertical list of sizes that the division will be based on. You
    then use the new_locator method, whose return value is a callable
    object that can be used to set the axes_locator of the axes.

iÿÿÿÿN(   t   SubplotBaset   Dividerc           B   s  e  Z d  Z d d d „ Z d „  Z d „  Z d „  Z e d „  ƒ Z	 e 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 d d d d „ Z d d d „ Z d „  Z d d d d d g d „ Z RS(   s¹  
    This is the class that is used calculates the axes position. It
    divides the given rectangular area into several
    sub-rectangles. You initialize the divider by setting the
    horizontal and vertical lists of sizes
    (:mod:`mpl_toolkits.axes_grid.axes_size`) that the division will
    be based on. You then use the new_locator method to create a
    callable object that can be used to as the axes_locator of the
    axes.
    t   Cc         C   sU   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d |  _ d |  _ d |  _	 d S(   sñ  
        :param fig: matplotlib figure
        :param pos: position (tuple of 4 floats) of the rectangle that
                    will be divided.
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division
        :param vertical: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for vertical division
        :param aspect: if True, the overall rectangular area is reduced
                    so that the relative part of the horizontal and
                    vertical scales have same scale.
        :param anchor: Determine how the reduced rectangle is placed
                       when aspect is True.
        i    N(
   t   _figt   _post   _horizontalt	   _verticalt   _anchort   _aspectt
   _xrefindext
   _yrefindext   Nonet   _locator(   t   selft   figt   post
   horizontalt   verticalt   aspectt   anchor(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   __init__"   s    								c         C   s&   g  |  j  ƒ  D] } | j | ƒ ^ q S(   N(   t   get_horizontalt   get_size(   R   t   renderert   s(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_horizontal_sizes>   s    c         C   s&   g  |  j  ƒ  D] } | j | ƒ ^ q S(   N(   t   get_verticalR   (   R   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_vertical_sizesA   s    c         C   s>   d d l  m } | |  j ƒ  ƒ } | |  j ƒ  ƒ } | | f S(   Niÿÿÿÿ(   t   AddList(   t	   axes_sizeR   R   R   (   R   R   t   vsizet   hsize(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_vsize_hsizeD   s    c         C   s]   d \ } } x( |  D]  \ } } | | 7} | | 7} q W| d k rU | | | } | Sd Sd  S(   Ng        (   g        g        (    (   t   lt
   total_sizet   rs_sumt   as_sumt   _rst   _ast   k(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   _calc_kN   s    
c         C   sA   d g } x1 |  D]) \ } } | j  | d | | | ƒ q W| S(   Ng        iÿÿÿÿ(   t   append(   R!   R'   t   offsetsR%   R&   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   _calc_offsets^   s    	!c         C   s   | |  _  d S(   s¡   
        set the position of the rectangle.

        :param pos: position (tuple of 4 floats) of the rectangle that
                    will be divided.
        N(   R   (   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   set_positionk   s    c         C   s   |  j  S(   s%   return the position of the rectangle.(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_positiont   s    c         C   s_   | t  j j j ƒ  k s* t | ƒ d k r6 | |  _ n% t d d j t  j j j ƒ  ƒ ƒ ‚ d S(   s‹  
        :param anchor: anchor position

          =====  ============
          value  description
          =====  ============
          'C'    Center
          'SW'   bottom left
          'S'    bottom
          'SE'   bottom right
          'E'    right
          'NE'   top right
          'N'    top
          'NW'   top left
          'W'    left
          =====  ============

        i   s   argument must be among %ss   , N(	   t   mtransformst   Bboxt   coefst   keyst   lenR   t
   ValueErrort   joint   BBox(   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
   set_anchorx   s    *c         C   s   |  j  S(   s   return the anchor(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
   get_anchor‘   s    c         C   s   | |  _  d S(   s¨   
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division

        .
        N(   R   (   R   t   h(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   set_horizontal•   s    c         C   s   |  j  S(   s   return horizontal sizes(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR       s    c         C   s   | |  _  d S(   s¨   
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division

        .
        N(   R   (   R   t   v(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   set_vertical¤   s    c         C   s   |  j  S(   s   return vertical sizes(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   ®   s    c         C   s   | |  _  d S(   s.   
        :param anchor: True or False
        N(   R   (   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
   set_aspect³   s    c         C   s   |  j  S(   s   return aspect(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
   get_aspect¹   s    c         C   s   | |  _  d  S(   N(   R   (   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   set_locator½   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_locatorÀ   s    c         C   s0   |  j  d  k r |  j ƒ  S|  j  | | ƒ j Sd  S(   N(   R   R   R-   t   bounds(   R   t   axR   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_position_runtimeÃ   s    
c         C   s  |  j  j ƒ  \ } } |  j | | ƒ \ }	 }
 } } |  j | ƒ } |  j | ƒ } |  j | | | ƒ } |  j | | | ƒ } |  j ƒ  rLt | | ƒ } |  j | | ƒ } |  j | | ƒ } | d | d | } | d | d | } t	 j
 j |	 |
 | | ƒ } t	 j
 j |	 |
 | | ƒ } | j |  j ƒ  | ƒ } | j | j } } n1 |  j | | ƒ } |  j | | ƒ } |	 |
 } } | d k r–| d } n  | d k r¯| d } n  | | | | | | | | | } } | | | | | | | | | } } t	 j
 j | | | | ƒ S(   sT  

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        iÿÿÿÿi    i   N(   R   t   get_size_inchesRB   R   R   R(   R=   t   minR+   R.   R/   t   from_boundst   anchoredR7   t   x0t   y0R   (   R   t   nxt   nyt   nx1t   ny1t   axesR   t   figWt   figHt   xt   yt   wR8   t   hsizest   vsizest   k_ht   k_vR'   t   oxt   oyt   wwt   hht   pbt   pb1t   pb1_anchoredRG   RH   t   x1t   w1t   y1t   h1(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   locateÉ   s4    ))c         C   s   t  |  | | | | ƒ S(   sÑ  
        returns a new locator
        (:class:`mpl_toolkits.axes_grid.axes_divider.AxesLocator`) for
        specified cell.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        (   t   AxesLocator(   R   RI   RJ   RK   RL   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   new_locatorú   s    c         C   s°   | d k r1 |  j  j d | ƒ |  j d 7_ n{ | d k rP |  j  j | ƒ n\ | d k r� |  j j d | ƒ |  j d 7_ n+ | d k r  |  j j | ƒ n t d ƒ ‚ d  S(   Nt   lefti    i   t   rightt   bottomt   tops7   the position must be one of left, right, bottom, or top(   R   t   insertR	   R)   R   R
   R3   (   R   t   positiont   size(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   append_size	  s    gš™™™™™¹?Re   Rf   Rg   Rh   c         C   sk   d d l  m } m } m } xH | D]@ } | | | ƒ } | | ƒ }	 | |	 | ƒ }
 |  j | |
 ƒ q# Wd  S(   Niÿÿÿÿ(   t   Paddedt   SizeFromFunct   GetExtentHelper(   R   Rm   Rn   Ro   Rl   (   R   t   use_axest   padt   adjust_dirsRm   Rn   Ro   t   dt   helperRk   t   padded_size(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   add_auto_adjustable_area  s    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R    t   staticmethodR(   R+   R,   R-   R6   R7   R9   R   R;   R   t   FalseR<   R=   R>   R?   RB   Rb   Rd   Rl   Rv   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR      s2   
			
								
					1	Rc   c           B   s/   e  Z d  Z d d d „ Z d „  Z d „  Z RS(   s|   
    A simple callable object, initialized with AxesDivider class,
    returns the position and size of the given cell.
    c         C   s†   | |  _  | j } | j } | | | | |  _ |  _ | d k rO | d } n  | d k rh | d } n  | | |  _ | | |  _ d S(   s–  
        :param axes_divider: An instance of AxesDivider class.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i   N(   t   _axes_dividerR	   R
   t   _nxt   _nyR   t   _nx1t   _ny1(   R   t   axes_dividerRI   RJ   RK   RL   R	   R
   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   *  s    			c         C   sS   |  j  j } |  j  j } |  j  j |  j | |  j | |  j | |  j | | | ƒ S(   N(   R|   R	   R
   Rb   R}   R~   R   R€   (   R   RM   R   R	   R
   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   __call__E  s    


c         C   s'   t  |  j d ƒ r |  j j ƒ  Sd  Sd  S(   Nt   get_subplotspec(   t   hasattrR|   Rƒ   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRƒ   Q  s    N(   Rw   Rx   Ry   R   R   R‚   Rƒ   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRc   %  s   	(   t   SubplotSpect   GridSpect   SubplotDividerc           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sT   
    The Divider class whose rectangle area is specified as a subplot geometry.
    c      
   O   s   | |  _  t | ƒ d k r­ t | d t ƒ r> | d |  _ q„y2 t t | d ƒ ƒ } t t | ƒ \ } } } Wn t k
 r� t d ƒ ‚ n Xt	 | | ƒ | d |  _ n× t | ƒ d k rq| \ } } } t | ƒ } t | ƒ } t | t
 ƒ rNt | ƒ d k rNg  | D] } t | ƒ ^ q} t	 | | ƒ | d d | d !|  _ q„t	 | | ƒ t | ƒ d |  _ n t d | f ƒ ‚ |  j ƒ  |  j j }	 | j d g  ƒ }
 | j d g  ƒ } | j d	 d ƒ } | j d
 d ƒ } | r÷t d ƒ ‚ n  t j |  | |	 |
 | d	 | d
 | ƒd S(   s  
        *fig* is a :class:`matplotlib.figure.Figure` instance.

        *args* is the tuple (*numRows*, *numCols*, *plotNum*), where
        the array of subplots in the figure has dimensions *numRows*,
        *numCols*, and where *plotNum* is the number of the subplot
        being created.  *plotNum* starts at 1 in the upper left
        corner and increases to the right.

        If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the
        decimal integer *numRows* * 100 + *numCols* * 10 + *plotNum*.
        i   i    s4   Single argument to subplot must be a 3-digit integeri   i   s"   Illegal argument(s) to subplot: %sR   R   R   R   R   t    N(   t   figureR2   t
   isinstanceR…   t   _subplotspect   strt   intt   mapR3   R†   t   tuplet   update_paramst   figboxR@   t   popR   t	   ExceptionR   R   (   R   R   t   argst   kwargsR   t   rowst   colst   numt   nR   R   R   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   `  s<    	!(#
c         C   s   |  j  ƒ  |  j j S(   s$   return the bounds of the subplot box(   R�   R‘   R@   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR-   §  s    
c         C   s   |  j  ƒ  j |  j ƒ |  _ d S(   s0   update the subplot position from fig.subplotparsN(   Rƒ   R-   R‰   R‘   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�   Í  s    c         C   s/   |  j  ƒ  j ƒ  \ } } } } | | | d f S(   s"   get the subplot geometry, eg 2,2,3i   (   Rƒ   t   get_geometry(   R   R–   R—   t   num1t   num2(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRš   Ò  s    c         C   s8   t  | | ƒ | d |  _ |  j ƒ  |  j |  j ƒ d S(   s2   change subplot geometry, e.g., from 1,1,1 to 2,2,3i   N(   R†   R‹   R�   R,   R‘   (   R   t   numrowst   numcolsR˜   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   change_geometryØ  s    
c         C   s   |  j  S(   s   get the SubplotSpec instance(   R‹   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRƒ   Þ  s    c         C   s   | |  _  d S(   s   set the SubplotSpec instanceN(   R‹   (   R   t   subplotspec(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   set_subplotspecâ  s    (
   Rw   Rx   Ry   R   R-   R�   Rš   RŸ   Rƒ   R¡   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR‡   Z  s   	G	&				t   AxesDividerc           B   sw   e  Z d  Z d
 d
 d „ Z d „  Z d
 e d „ Z d
 e d „ Z d
 e	 d „ Z
 d „  Z d „  Z d „  Z d	 „  Z RS(   s1   
    Divider based on the pre-existing axes.
    c         C   s¤   | |  _  | d k r* t j | ƒ |  _ n	 | |  _ | d k rT t j | ƒ |  _ n	 | |  _ t j |  d | j	 ƒ  d d d |  j g d |  j g d d d d ƒd S(	   s#   
        :param axes: axes
        R   R   R   R   R   R   R   N(
   t   _axesR   t   Sizet   AxesXt   _xreft   AxesYt   _yrefR   R   t
   get_figure(   R   RM   t   xreft   yref(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   í  s    			c         K   sy   |  j  } | j d d  ƒ } | d  k rQ t | t ƒ rB | j } qQ t | ƒ } n  | | j ƒ  | j d t	 ƒ | � } | S(   Nt
   axes_classt   original(
   R£   R’   R   RŠ   R    t   _axes_classt   typeR©   R-   t   True(   R   R•   RM   R¬   RA   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   _get_new_axesÿ  s    	c         K   s6  | rq t  | t j ƒ s3 t j | d |  j ƒ} n  | r^ |  j j d | ƒ |  j d 7_ qq |  j j | ƒ n  t  | t j ƒ sž t j | d |  j ƒ} n  | rá |  j j d | ƒ |  j d 7_ |  j	 d d d d ƒ } n5 |  j j | ƒ |  j	 d t
 |  j ƒ d d d ƒ } |  j | �  } | j | ƒ | S(   so  
        Add a new axes on the right (or left) side of the main axes.

        :param size: A width of the axes. A :mod:`~mpl_toolkits.axes_grid.axes_size`
          instance or if float or string is given, *from_any*
          function is used to create one, with *ref_size* set to AxesX instance
          of the current axes.
        :param pad: pad between the axes. It takes same argument as *size*.
        :param pack_start: If False, the new axes is appended at the end
          of the list, i.e., it became the right-most axes. If True, it is
          inserted at the start of the list, and becomes the left-most axes.

        All extra keywords arguments are passed to the created axes.
        If *axes_class* is given, the new axes will be created as an
        instance of the given class. Otherwise, the same class of the
        main axes will be used.
        t   fraction_refi    i   RI   RJ   (   RŠ   R¤   t   _Baset   from_anyR¦   R   Ri   R	   R)   Rd   R2   R±   t   set_axes_locator(   R   Rk   Rq   t
   pack_startR•   t   locatorRA   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   new_horizontal  s(    %c         K   s6  | rq t  | t j ƒ s3 t j | d |  j ƒ} n  | r^ |  j j d | ƒ |  j d 7_ qq |  j j | ƒ n  t  | t j ƒ sž t j | d |  j ƒ} n  | rá |  j j d | ƒ |  j d 7_ |  j	 d d d d ƒ } n5 |  j j | ƒ |  j	 d d d t
 |  j ƒ d ƒ } |  j | �  } | j | ƒ | S(   sp  
        Add a new axes on the top (or bottom) side of the main axes.

        :param size: A height of the axes. A :mod:`~mpl_toolkits.axes_grid.axes_size`
          instance or if float or string is given, *from_any*
          function is used to create one, with *ref_size* set to AxesX instance
          of the current axes.
        :param pad: pad between the axes. It takes same argument as *size*.
        :param pack_start: If False, the new axes is appended at the end
          of the list, i.e., it became the top-most axes. If True, it is
          inserted at the start of the list, and becomes the bottom-most axes.

        All extra keywords arguments are passed to the created axes.
        If *axes_class* is given, the new axes will be created as an
        instance of the given class. Otherwise, the same class of the
        main axes will be used.
        R²   i    i   RI   RJ   (   RŠ   R¤   R³   R´   R¨   R   Ri   R
   R)   Rd   R2   R±   Rµ   (   R   Rk   Rq   R¶   R•   R·   RA   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   new_vertical>  s(    %c         K   sÑ   | d k r* |  j  | | d t | �} nŠ | d k rT |  j  | | d t | �} n` | d k r~ |  j | | d t | �} n6 | d k r¨ |  j | | d t | �} n t d ƒ ‚ | rÍ |  j j | ƒ n  | S(   s÷   
        create an axes at the given *position* with the same height
        (or width) of the main axes.

         *position*
           ["left"|"right"|"bottom"|"top"]

         *size* and *pad* should be axes_grid.axes_size compatible.
        Re   R¶   Rf   Rg   Rh   s7   the position must be one of left, right, bottom, or top(   R¸   R°   R{   R¹   R3   R   t   add_axes(   R   Rj   Rk   Rq   t   add_to_figureR•   RA   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   append_axesm  s    c         C   s@   |  j  d  k r5 |  j j ƒ  } | d k r. t St Sn |  j  Sd  S(   Nt   auto(   R   R   R£   R=   R{   R°   (   R   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR=   ˆ  s    c         C   s6   |  j  d  k r+ |  j j d t ƒ } | j S|  j  Sd  S(   NR­   (   R   R   R£   R-   R°   R@   (   R   t   bbox(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR-   ’  s    c         C   s'   |  j  d  k r |  j j ƒ  S|  j  Sd  S(   N(   R   R   R£   R7   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR7   ™  s    c         C   s'   t  |  j d ƒ r |  j j ƒ  Sd  Sd  S(   NRƒ   (   R„   R£   Rƒ   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRƒ      s    N(   Rw   Rx   Ry   R   R   R±   R{   R¸   R¹   R°   R¼   R=   R-   R7   Rƒ   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR¢   è  s   	./	
		t   HBoxDividerc           B   sY   e  Z d  „  Z e d „  ƒ Z e d „  ƒ Z d d „ Z d „  Z d d d d d „ Z	 RS(   c         O   s   t  j |  | | | Ž d  S(   N(   R‡   R   (   R   R   R”   R•   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   «  s    c         C   sœ  t  |  ƒ } d d  l } | j | j | d | d f d d ƒƒ } | j | d d d ƒ} xK t |  ƒ D]= \ } \ }	 }
 |	 | | | f <d | | d f <|
 | | <qj Wg  | D] \ }	 }
 |	 ^ q² | d d  d … f <| t g  | D] \ } }
 |
 ^ qç ƒ | d <| j | j | ƒ j j } | d  } | d } | | k r˜| | j	 g  |  D] \ }	 }
 |
 ^ qSƒ | j	 g  |  D] \ }	 }
 |	 ^ qyƒ } n  | S(   Niÿÿÿÿi   t   dtypeRs   (
   R2   t   numpyt   matt   zerost	   enumeratet   sumt   It   Tt   A1t   array(   t   equivalent_sizest   appended_sizest   max_equivalent_sizet   total_appended_sizeR™   t   npt   At   Bt   it   rt   at   rst   karray_Ht   karrayt   H(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   _determine_karray¯  s$    ,/-

&,c         C   sP   d g } x@ t  |  | ƒ D]/ \ \ } } } | j | d | | | ƒ q W| S(   Ng        iÿÿÿÿ(   t   zipR)   (   RË   RÖ   R*   RÒ   RÓ   R'   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR+   Î  s    	"!c         C   s   t  |  | d | d ƒ S(   sÑ  
        returns a new locator
        (:class:`mpl_toolkits.axes_grid.axes_divider.AxesLocator`) for
        specified cell.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i    N(   Rc   R   (   R   RI   RK   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRd   Ù  s    c	         C   sù   | }	 | }
 | | } | | } |  j  |	 |
 | | ƒ } |  j |
 | ƒ } | d | d | } |	 d } | d | d | d | } t j j | | | | ƒ } t j j | | | | ƒ } | j |  j ƒ  | ƒ } | j | j } } | | | | f S(   sT  

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        iÿÿÿÿi    i   (	   RØ   R+   R.   R/   RE   RF   R7   RG   RH   (   R   RP   RQ   RR   R8   t   y_equivalent_sizest   x_appended_sizesRN   RO   RÊ   RË   RÌ   RÍ   RÖ   RW   RY   t   ref_hRZ   R[   R\   R]   RG   RH   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   _locateé  s     

	
c      	   C   sé   |  j  j ƒ  \ } } |  j | | ƒ \ }	 }
 } } |  j | ƒ } |  j | ƒ } |  j |	 |
 | | | | | | ƒ \ } } } } | d k rš | d } n  | | | | | | | | | } } | | } } t j j	 | | | | ƒ S(   sT  

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i   N(
   R   RC   RB   R   R   RÝ   R   R.   R/   RE   (   R   RI   RJ   RK   RL   RM   R   RN   RO   RP   RQ   RR   R8   RÚ   RÛ   RG   RH   RW   RZ   R^   R_   R`   Ra   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRb     s    )N(
   Rw   Rx   R   Rz   RØ   R+   R   Rd   RÝ   Rb   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR¿   ¨  s   		#t   VBoxDividerc           B   s/   e  Z d  Z d d „ Z d d d d d „ Z RS(   sT   
    The Divider class whose rectangle area is specified as a subplot geometry.
    c         C   s   t  |  d | d | ƒ S(   sÑ  
        returns a new locator
        (:class:`mpl_toolkits.axes_grid.axes_divider.AxesLocator`) for
        specified cell.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i    N(   Rc   R   (   R   RJ   RL   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRd   0  s    c      	   C   sé   |  j  j ƒ  \ } } |  j | | ƒ \ }	 }
 } } |  j | ƒ } |  j | ƒ } |  j |
 |	 | | | | | | ƒ \ } } } } | d k rš | d } n  | | } } | | | | | | | | | } } t j j	 | | | | ƒ S(   sT  

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i   N(
   R   RC   RB   R   R   RÝ   R   R.   R/   RE   (   R   RI   RJ   RK   RL   RM   R   RN   RO   RP   RQ   RR   R8   t   x_equivalent_sizest   y_appended_sizesRH   RG   RX   RY   R^   R_   R`   Ra   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRb   @  s    )N(   Rw   Rx   Ry   R   Rd   Rb   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRÞ   *  s   t   LocatableAxesBasec           B   s>   e  Z d  „  Z d „  Z d „  Z d d „ Z d e d „ Z RS(   c         O   s,   |  j  j |  | | Ž d  |  _ d  |  _ d  S(   N(   R®   R   R   R   t   _locator_renderer(   R   t   klt   kw(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR   b  s    	c         C   s   | |  _  d  S(   N(   R   (   R   R·   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRµ   i  s    c         C   s   |  j  S(   N(   R   (   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   get_axes_locatorl  s    c         C   sZ   |  j  ƒ  d  k r( |  j j |  | ƒ n. |  j  ƒ  |  |  j ƒ } |  j j |  d | ƒd  S(   NRj   (   Rå   R   R®   t   apply_aspectRâ   (   R   Rj   R   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRæ   o  s    c         C   s#   | |  _  |  j j |  | | ƒ d  S(   N(   Râ   R®   t   draw(   R   R   t   inframe(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRç   x  s    	N(	   Rw   Rx   R   Rµ   Rå   R   Ræ   R{   Rç   (    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRá   a  s
   				c         C   sR   t  j |  ƒ } | d  k rN t d |  j t |  f i |  d 6ƒ } | t  |  <n  | S(   Ns   Locatable%sR®   (   t   _locatableaxes_classest   getR   R¯   Rw   Rá   (   R¬   t	   new_class(    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   locatable_axes_factory�  s    	c         C   sb   t  |  d ƒ s- t t |  ƒ ƒ } | |  _ n  t |  ƒ } | j d d d d ƒ } |  j | ƒ | S(   NRµ   RI   i    RJ   (   R„   Rì   R¯   t	   __class__R¢   Rd   Rµ   (   RM   Rë   t   dividerR·   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   make_axes_locatable‘  s    gš™™™™™¹?Re   Rf   Rg   Rh   c         C   sA   t  |  ƒ } | d  k r! |  } n  | j d | d | d | ƒ d  S(   NRp   Rq   Rr   (   Rï   R   Rv   (   RA   Rp   Rq   Rr   Rî   (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   make_axes_area_auto_adjustableœ  s
    	(   t   Axes(   Ry   t   matplotlib.transformst
   transformsR.   t   matplotlib.axesR    R   R¤   t   objectR   Rc   t   matplotlib.gridspecR…   R†   R‡   R¢   R¿   RÞ   Rá   Ré   Rì   Rï   R   Rð   t   mpl_axesRñ   t   LocatableAxes(    (    (    s^   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt   <module>   s&   ÿ 3ŽÀ‚7		