ó
±éRc           @   sN  d  Z  d d l Z d d l m Z d d l j Z d d l m Z m Z d d l	 m
 Z
 d d l j Z d d l m Z d d l j Z d d l	 m Z d d l j Z d d l m Z d d l Z d d	 l m Z m Z m Z d d l Z d d l Z d d l  Z  d
 „  Z! d e f d „  ƒ  YZ" d d „ Z# d d l$ j% Z& e& j' j( e" ƒ d S(   sZ   
Module containing Axes3D, an object which can plot 3D objects on a
2D matplotlib figure.
iÿÿÿÿN(   t
   itemgetter(   t   Axest   rcParams(   t   cbook(   t   Bbox(   t	   docstring(   t   Triangulation(   t	   Normalizet   colorConvertert   LightSourcec          C   s+   t  t j d d g d d g g ƒ ƒ }  |  S(   Ni    i   (   R   t   npt   array(   t   box(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt	   unit_bbox    s    't   Axes3Dc           B   sù  e  Z d  Z d Z e j ƒ  Z dj d „ Z d „  Z	 d „  Z
 d „  Z d „  Z dj dj dj dj d „ Z d „  Z d	 „  Z d
 „  Z dj d „ Z dj dj d „ Z dj dj d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d dj d „ Z dj dj d „ Z dj e e e d „ Z  d „  Z! dj dj d „ Z" dj dj e e# d „ Z$ e$ Z% dj dj e e# d „ Z& e& Z' dj dj e e# d „ Z( e( Z) d  „  Z* e+ j, j- j e* _ e* Z- e- j d! 7_ d" „  Z. e+ j, j/ j e. _ e. Z/ e/ j d# 7_ d$ „  Z0 e0 Z1 d% „  Z2 d& „  Z3 e+ j, j3 j d' e3 _ d( „  Z4 e+ j, j4 j d' e4 _ e5 j6 d) „  ƒ Z7 d* „  Z8 e# d+ „ Z9 d, „  Z: d- „  Z; d. „  Z< e# d/ „ Z= dj d0 „ Z> d1 „  Z? d2 „  Z@ dj dj d3 „ ZA d4 „  ZB d5 d6 d7 „ ZC d8 „  ZD d9 „  ZE d: „  ZF d; „  ZG d< „  ZH d= „  ZI d> „  ZJ d? „  ZK d@ „  ZL dj dj dA „ ZM dB „  ZN dC „  ZO dD „  ZP dE „  ZQ dF „  ZR e dG „ ZS dH „  ZT d dj dI „ ZU d dJ „ ZV dK „  ZW dL „  ZX dM „  ZY dj dj dN „ ZZ dj dO „ Z[ e[ Z\ e, j[ Z] dP „  Z^ e^ Z_ dQ „  Z` dR „  Za dS „  Zb dT „  Zc dU „  Zd dV „  Ze dW dX „ Zf e# dW dY dj dZ „ Zg dY dj d[ „ Zh d\ „  Zi ei Zj d] „  Zk d^ „  Zl el Zm dj dY d_ „ Zn d` dY da „ Zo d` dY db dc dd „ Zp ep Zq d` dY de „ Zr dc df dg „ Zs dj dh di „ Zt e+ j, jt j et _ RS(k   s   
    3D axes object.
    t   3dc   	      O   sL  d i d j  g  t j ƒ  D] } t | ƒ ^ q ƒ d 6| d  k rX d d d d g } n  g  |  _ | j d d ƒ |  _ | j d d	 ƒ |  _ | j d
 d  ƒ } | j d d  ƒ } t	 ƒ  |  _
 t	 ƒ  |  _ t	 ƒ  |  _ t	 ƒ  |  _ |  j |  j |  j ƒ d |  _ | |  _ | d  k	 r2|  j j  |  | ƒ d |  _ n  t j |  | | d t | | Žt j |  ƒ |  j ƒ  d  |  _ d  |  _ | d  k	 r–|  j | ƒ n  |  j d  k	 rÆ|  j j j d |  j ƒ |  _ n	 d  |  _ d |  _ |  j  ƒ  |  j! ƒ  |  j" j# d ƒ |  j$ j% ƒ  j& d d g ƒ } | d | d \ |  _' |  _( |  j) j* |  ƒ d  S(   Ns  
        Build an :class:`Axes3D` instance in
        :class:`~matplotlib.figure.Figure` *fig* with
        *rect=[left, bottom, width, height]* in
        :class:`~matplotlib.figure.Figure` coordinates

        Optional keyword arguments:

          ================   =========================================
          Keyword            Description
          ================   =========================================
          *azim*             Azimuthal viewing angle (default -60)
          *elev*             Elevation viewing angle (default 30)
          *zscale*           [%(scale)s]
          *sharez*           Other axes to share z-limits with
          ================   =========================================

        .. versionadded :: 1.2.1
            *sharez*

        s    | t   scaleg        g      ð?t   azimiÄÿÿÿt   elevi   t   zscalet   sharezi    t   datalimt   frameons   units finalizei   (   i    i    (   i   i   (+   t   joint   mscalet   get_scale_namest   reprt   Nonet   _cidst   popt   initial_azimt   initial_elevR   t
   xy_viewLimt
   zz_viewLimt
   xy_dataLimt
   zz_dataLimt	   view_initt   _readyt   _sharezt   _shared_z_axest   _adjustableR   t   __init__t   Truet   set_axis_offt   set_axis_ont   Mt	   fmt_zdatat
   set_zscalet   zaxist	   callbackst   connectt   relimt   _zcidt
   mouse_initt   set_top_viewt	   axesPatcht   set_linewidtht   transLimitst   invertedt	   transformt	   _pseudo_wt	   _pseudo_ht   figuret   add_axes(	   t   selft   figt   rectt   argst   kwargst   xR   R   t   pseudo_bbox(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR)   +   sL    7			

				

c         C   s   t  |  _ d  S(   N(   t   Falset	   _axis3don(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR+   y   s    c         C   s   t  |  _ d  S(   N(   R*   RH   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR,   |   s    c         C   s+   |  j  j ƒ  p* |  j j ƒ  p* |  j j ƒ  S(   sN   
        Return *True* if units are set on the *x*, *y*, or *z* axes

        (   t   xaxist
   have_unitst   yaxisR0   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRJ      s    c         C   s   |  j  j | ƒ S(   s–   
        For artists in an axes, if the zaxis has units support,
        convert *z* using zaxis unit type

        .. versionadded :: 1.2.1

        (   R0   t   convert_units(   R@   t   z(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   convert_zunits‡   s    c         C   sð   t  j |  d | d | d | ƒ|  j d k sL |  j d k sL |  j d k rP d S| d k	 r� |  j j ƒ  s� |  j j | ƒ q� n  | d k	 rì | j d |  j j	 ƒ } | |  j j	 k rì |  j j
 | ƒ | d k	 ré |  j j | ƒ qé qì n  d S(   sT   
        Look for unit *kwargs* and update the axis instances as necessary

        t   xdatat   ydataRD   Nt   zunits(   R   t   _process_unit_infoRI   R   RK   R0   RJ   t   update_unitsR   t   unitst	   set_units(   R@   RO   RP   t   zdataRD   RQ   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRR   ‘   s    -c         C   sl   d |  j  } d |  j  } d |  j  } d |  j  } t j |  | | d d  ƒt j |  | | d d  ƒd  S(   Ngffffffî?gÍÌÌÌÌÌì?t   auto(   t   distR   t   set_xlimR   t   set_ylim(   R@   t   xdwlt   xdwt   ydwlt   ydw(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR6   «   s    c         C   sÊ   t  j d |  j j |  j j |  ƒ |  _ |  j |  _ t  j d |  j j |  j j |  ƒ |  _	 |  j	 |  _
 t  j d |  j j |  j j |  ƒ |  _ |  j |  _ x* |  j |  j
 |  j f D] } | j ƒ  q² Wd S(   s4   Init 3D axes; overrides creation of regular X/Y axesRE   t   yRM   N(   t   axis3dt   XAxisR    t	   intervalxR"   t   w_xaxisRI   t   YAxist	   intervalyt   w_yaxisRK   t   ZAxisR!   R#   t   w_zaxisR0   t   init3d(   R@   t   ax(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   _init_axis¸   s    c         C   s   |  j  g t j |  ƒ S(   N(   R0   R   t   get_children(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRl   Ç   s    c      
   C   s�   | p |  j  ƒ  \ } } } } } } | | | | | | | | g | | | | | | | | g | | | | | | | | g } }	 }
 t | |	 |
 ƒ S(   N(   t
   get_w_limst   zip(   R@   t   valst   minxt   maxxt   minyt   maxyt   minzt   maxzt   xst   yst   zs(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt	   unit_cubeÊ   s
    $&c         C   s=   | d  k r |  j } n  |  j | ƒ } t j | | ƒ } | S(   N(   R   R-   Ry   t   proj3dt   proj_points(   R@   Ro   R-   t   xyzst   tcube(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   tunit_cubeÑ   s
    c         C   sè   |  j  | | ƒ } | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f | d | d f g } | S(	   Ni    i   i   i   i   i   i   i   (   R~   (   R@   Ro   R-   t   tct   edges(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   tunit_edgesØ   s    c   	      C   s²  |  j  j | ƒ t |  _ |  j ƒ  |  _ |  j | _ |  j | _ |  j | _ |  j | _ g  |  j	 D] } | j
 | ƒ | f ^ qb } | j d t d ƒ d t ƒ x) t | ƒ D] \ } \ } } | | _ q¬ Wg  |  j D] } | j
 | ƒ | f ^ qÕ } | j d t d ƒ d t ƒ x) t | ƒ D] \ } \ } } | | _ qW|  j rž|  j |  j |  j f } x | D] } | j | ƒ qfWx | D] } | j | ƒ q„Wn  t j |  | ƒ d  S(   Nt   keyi    t   reverse(   R7   t   drawRG   t   _frameont   get_projR-   t   vvect   eyet   get_axis_positiont   collectionst   do_3d_projectiont   sortR    R*   t	   enumeratet   zordert   patchesRH   RI   RK   R0   t	   draw_paneR   (	   R@   t   renderert   colt   zlistt   iRM   t   patcht   axesRj   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR„   ê   s0    	((	c         C   s‚   |  j  ƒ  } |  j | |  j ƒ } | d d | d d k } | d d | d d k } | d d | d d k } | | | f S(   Ni   i   i   i    (   Rm   R~   R-   (   R@   Ro   R   t   xhight   yhight   zhigh(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR‰     s    c         K   s   d  S(   N(    (   R@   t   xysRD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   update_datalim  s    c         C   s   t  j |  ƒ o |  j ƒ  S(   sÁ   
        Get whether autoscaling is applied for all axes on plot commands

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        (   R   t   get_autoscale_ont   get_autoscalez_on(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRœ     s    c         C   s   |  j  S(   sÃ   
        Get whether autoscaling for the z-axis is applied on plot commands

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        (   t   _autoscaleZon(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR�   $  s    c         C   s!   t  j |  | ƒ |  j | ƒ d S(   sÛ   
        Set whether autoscaling is applied on plot commands

        accepts: [ *True* | *False* ]

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        N(   R   t   set_autoscale_ont   set_autoscalez_on(   R@   t   b(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRŸ   -  s    	c         C   s   | |  _  d S(   sê   
        Set whether autoscaling for the z-axis is applied on plot commands

        accepts: [ *True* | *False* ]

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        N(   t   _autoscalez_on(   R@   R¡   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR    9  s    	c         C   s4   | d k  s | d k r' t  d ƒ ‚ n  | |  _ d S(   sU  
        Set padding of Z data limits prior to autoscaling.

        *m* times the data interval will be added to each
        end of that interval before it is used in autoscaling.

        accepts: float in range 0 to 1

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        i    i   s   margin must be in range 0 to 1N(   t
   ValueErrort   _zmargin(   R@   t   m(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   set_zmarginD  s    c   
   	   O   s‚  | r$ | r$ |  j  |  j |  j f S| j d t ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } t | ƒ d k r“ | d } } } nQ t | ƒ d k r´ | \ } } n0 t | ƒ d k rØ | \ } } } n t d	 ƒ ‚ | d k	 r |  j | ƒ n  | d k	 r|  j	 | ƒ n  | d k	 r8|  j
 | ƒ n  | d k	 } | d k	 } | d k	 }	 |  j d | d
 | d | d |	 ƒ d S(   sÑ  
        Convenience method to set or retrieve autoscaling margins.

        signatures::
            margins()

        returns xmargin, ymargin, zmargin

        ::

            margins(margin)

            margins(xmargin, ymargin, zmargin)

            margins(x=xmargin, y=ymargin, z=zmargin)

            margins(..., tight=False)

        All forms above set the xmargin, ymargin and zmargin
        parameters. All keyword parameters are optional.  A single argument
        specifies xmargin, ymargin and zmargin.  The *tight* parameter
        is passed to :meth:`autoscale_view`, which is executed after
        a margin is changed; the default here is *True*, on the
        assumption that when margins are specified, no additional
        padding to match tick marks is usually desired.  Setting
        *tight* to *None* will preserve the previous setting.

        Specifying any margin changes only the autoscaling; for example,
        if *xmargin* is not None, then *xmargin* times the X data
        interval will be added to each end of that interval before
        it is used in autoscaling.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        t   tightRE   R_   RM   i   i    i   i   s'   more than three arguments were suppliedt   scalext   scaleyt   scalezN(   t   _xmargint   _ymarginR¤   R   R*   R   t   lenR£   t   set_xmargint   set_ymarginR¦   t   autoscale_view(
   R@   RC   t   kwR§   t   mxt   myt   mzR¨   R©   Rª   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   marginsT  s0    $t   bothc      	   C   sÎ   | d	 k r! t } t } t } n‡ t } t } t } | d
 k rZ t | ƒ |  _ |  j } n  | d k r� t | ƒ |  _ |  j } n  | d k r¨ t | ƒ |  _ |  j } n  |  j d | d | d | d | ƒ d	 S(   s§  
        Convenience method for simple axis view autoscaling.
        See :meth:`matplotlib.axes.Axes.autoscale` for full explanation.
        Note that this function behaves the same, but for all
        three axes.  Therfore, 'z' can be passed for *axis*,
        and 'both' applies to all three axes.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        RE   R¶   R_   RM   R§   R¨   R©   Rª   N(   RE   R¶   (   R_   R¶   (   RM   R¶   (   R   R*   RG   t   boolt   _autoscaleXont   _autoscaleYonRž   R°   (   R@   t   enablet   axisR§   R¨   R©   Rª   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt	   autoscale–  s$    	c         C   sÜ   t  t j | | | f ƒ \ } } } y8 | j ƒ  | j ƒ  } } | d  k	 r[ | j ƒ  } n  Wn t k
 rr ‚  n X|  j j t j | | g ƒ j	 | ƒ | d  k	 rÎ |  j
 j t j | | g ƒ j	 | ƒ n  |  j ƒ  d  S(   N(   t   mapR
   t   asarrayt   flattenR   t   AttributeErrorR"   t   update_from_data_xyR   t   TR#   R°   (   R@   t   Xt   Yt   Zt   had_dataRE   R_   RM   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   auto_scale_xyzµ  s    $&)c         C   s  |  j  s d S| d k rd |  j p^ t |  j ƒ d k o^ t |  j ƒ d k o^ t |  j ƒ d k } n t | ƒ } |  _ | r¦|  j r¦|  j	 j
 |  ƒ } g  | D] } | j ^ qŸ } t j j | ƒ }	 |  j j \ }
 } |  j j ƒ  } y | j |
 | ƒ \ }
 } Wn5 t k
 r:t j |
 | d t d d ƒ\ }
 } n X|  j d k rr| |
 |  j } |
 | 8}
 | | 7} n  | s“| j |
 | ƒ \ }
 } n  |  j |
 | ƒ n  | rÕ|  j rÕ|  j j
 |  ƒ } g  | D] } | j ^ qÎ} t j j | ƒ }	 |  j j \ } } |  j j ƒ  } y | j | | ƒ \ } } Wn5 t k
 rit j | | d t d d ƒ\ } } n X|  j d k r¡| | |  j } | | 8} | | 7} n  | sÂ| j | | ƒ \ } } n  |  j | | ƒ n  | r|  j r|  j  j
 |  ƒ } g  | D] } | j ^ qý} t j j | ƒ }	 |  j! j \ } } |  j" j ƒ  } y | j | | ƒ \ } } Wn5 t k
 r˜t j | | d t d d ƒ\ } } n X|  j# d k rÐ| | |  j# } | | 8} | | 7} n  | sñ| j | | ƒ \ } } n  |  j$ | | ƒ n  d S(   s  
        Autoscale the view limits using the data limits.
        See :meth:`matplotlib.axes.Axes.autoscale_view` for documentation.
        Note that this function applies to the 3D axes, and as such
        adds the *scalez* to the function arguments.

        .. versionchanged :: 1.1.0
            Function signature was changed to better match the 2D version.
            *tight* is now explicitly a kwarg and placed first.

        .. versionchanged :: 1.2.1
            This is now fully functional.

        Ni    t
   increasingt   expandergš™™™™™©?(%   R%   R   t   _tightR­   t   imagest   linesR�   R·   R¸   t   _shared_x_axest   get_siblingst   dataLimt   mtransformst   BboxBaset   unionR"   Rb   RI   t   get_major_locatort   nonsingularRÀ   RG   R«   t   view_limitst
   set_xboundR¹   t   _shared_y_axesRe   RK   R¬   t
   set_yboundRž   R'   R#   R0   R¤   t
   set_zbound(   R@   R§   R¨   R©   Rª   RÊ   t   xsharedRj   t   dlt   bbt   x0t   x1t   xlocatort   deltat   ysharedt   y0t   y1t   ylocatort   zsharedt   z0t   z1t   zlocator(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR°   È  sz    	


c         C   sL   |  j  ƒ  \ } } |  j ƒ  \ } } |  j ƒ  \ } } | | | | | | f S(   s   Get 3D world limits.(   t
   get_xlim3dt
   get_ylim3dt
   get_zlim3d(   R@   Rp   Rq   Rr   Rs   Rt   Ru   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRm     s    c         O   sW   | d  k r* t j | ƒ r* | \ } } n  | | k rM | d 8} | d 7} n  | | f S(   Ngš™™™™™©?(   R   R   t   iterable(   R@   t   xmint   xmaxRC   RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   _determine_lims%  s    
c   	      K   sJ  d | k r | j  d ƒ } n  d | k r< | j  d ƒ } n  | r[ t d | j ƒ  ƒ ‚ n  | d
 k r… t j | ƒ r… | \ } } n  |  j d | | f ƒ | d
 k	 r¹ |  j | ƒ } n  | d
 k	 r× |  j | ƒ } n  |  j ƒ  \ } } | d
 k rþ | } n  | d
 k r| } n  | | k r9t	 j
 d | | f ƒ n  t j | | d t ƒ\ } } |  j j | | ƒ \ } } | | f |  j _ | d
 k	 r¢t | ƒ |  _ n  | r@|  j j d |  ƒ x‚ |  j j |  ƒ D]k } | |  k	 rÎ| j |  j j d t d	 | ƒ| j |  j k r9| j j d
 k	 r9| j j j ƒ  q9qÎqÎWn  | | f S(   sn   
        Set 3D x limits.

        See :meth:`matplotlib.axes.Axes.set_xlim` for full documentation.

        Rí   Rî   s   unrecognized kwargs: %sRO   sw   Attempting to set identical left==right results
in singular transformations; automatically expanding.
left=%s, right=%sRÈ   t   xlim_changedt   emitRW   N(   R   R£   t   keysR   R   Rì   RR   t   convert_xunitst   get_xlimt   warningst   warnRÐ   RÔ   RG   RI   t   limit_range_for_scaleR    Rb   R·   R¸   R1   t   processRÍ   RÎ   RY   R>   t   canvast	   draw_idle(	   R@   t   leftt   rightRñ   RW   R±   t   old_leftt	   old_rightt   other(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_xlim3d-  sH    			c   	      K   sJ  d | k r | j  d ƒ } n  d | k r< | j  d ƒ } n  | r[ t d | j ƒ  ƒ ‚ n  | d
 k r… t j | ƒ r… | \ } } n  |  j d | | f ƒ | d
 k	 r¹ |  j | ƒ } n  | d
 k	 r× |  j | ƒ } n  |  j ƒ  \ } } | d
 k rþ | } n  | d
 k r| } n  | | k r9t	 j
 d | | f ƒ n  t j | | d t ƒ\ } } |  j j | | ƒ \ } } | | f |  j _ | d
 k	 r¢t | ƒ |  _ n  | r@|  j j d |  ƒ x‚ |  j j |  ƒ D]k } | |  k	 rÎ| j |  j j d t d	 | ƒ| j |  j k r9| j j d
 k	 r9| j j j ƒ  q9qÎqÎWn  | | f S(   sn   
        Set 3D y limits.

        See :meth:`matplotlib.axes.Axes.set_ylim` for full documentation.

        t   ymint   ymaxs   unrecognized kwargs: %sRP   sw   Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=%s, top=%sRÈ   t   ylim_changedRñ   RW   N(   R   R£   Rò   R   R   Rì   RR   t   convert_yunitst   get_ylimRõ   Rö   RÐ   RÔ   RG   RK   R÷   R    Re   R·   R¹   R1   Rø   R×   RÎ   RZ   R>   Rù   Rú   (	   R@   t   bottomt   topRñ   RW   R±   t
   old_bottomt   old_topRÿ   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_ylim3dd  sH    			c   	      K   sJ  d | k r | j  d ƒ } n  d | k r< | j  d ƒ } n  | r[ t d | j ƒ  ƒ ‚ n  | d
 k r… t j | ƒ r… | \ } } n  |  j d | | f ƒ | d
 k	 r¹ |  j | ƒ } n  | d
 k	 r× |  j | ƒ } n  |  j ƒ  \ } } | d
 k rþ | } n  | d
 k r| } n  | | k r9t	 j
 d | | f ƒ n  t j | | d t ƒ\ } } |  j j | | ƒ \ } } | | f |  j _ | d
 k	 r¢t | ƒ |  _ n  | r@|  j j d |  ƒ x‚ |  j j |  ƒ D]k } | |  k	 rÎ| j |  j j d t d	 | ƒ| j |  j k r9| j j d
 k	 r9| j j j ƒ  q9qÎqÎWn  | | f S(   sm   
        Set 3D z limits.

        See :meth:`matplotlib.axes.Axes.set_ylim` for full documentation

        t   zmint   zmaxs   unrecognized kwargs: %sRV   sw   Attempting to set identical bottom==top results
in singular transformations; automatically expanding.
bottom=%s, top=%sRÈ   t   zlim_changedRñ   RW   N(   R   R£   Rò   R   R   Rì   RR   RN   t   get_zlimRõ   Rö   RÐ   RÔ   RG   R0   R÷   R!   Rb   R·   Rž   R1   Rø   R'   RÎ   t   set_zlimR>   Rù   Rú   (	   R@   R  R  Rñ   RW   R±   R  R	  Rÿ   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_zlim3dš  sH    			c         C   s
   |  j  j S(   N(   R    Rb   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRé   Ð  s    sn   
        .. versionchanged :: 1.1.0
            This function now correctly refers to the 3D x-limits
        c         C   s
   |  j  j S(   N(   R    Re   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRê   Ù  s    so   
        .. versionchanged :: 1.1.0
            This function now correctly refers to the 3D y-limits.
        c         C   s
   |  j  j S(   s   Get 3D z limits.(   R!   Rb   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRë   â  s    c         C   s$   d d j  t j ƒ  ƒ |  j j ƒ  S(   Ns¡   
        Return the zaxis scale string %s

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        s   , (   R   R   R   R0   t	   get_scale(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   get_zscaleç  s    c         K   s7   |  j  j | | � |  j d t d t ƒ |  j ƒ  d  S(   NR©   Rª   (   RI   t
   _set_scaleR°   RG   t   _update_transScale(   R@   t   valueRD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_xscaleò  s    sx   

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        c         K   s7   |  j  j | | � |  j d t d t ƒ |  j ƒ  d  S(   NR¨   Rª   (   RK   R  R°   RG   R  (   R@   R  RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_yscaleü  s    c         K   s7   |  j  j | | � |  j d t d t ƒ |  j ƒ  d S(   s  
        call signature::

          set_zscale(value)

        Set the scaling of the z-axis: %(scale)s

        ACCEPTS: [%(scale)s]

        Different kwargs are accepted, depending on the scale:
        %(scale_docs)s

        .. note ::
            Currently, Axes3D objects only supports linear scales.
            Other scales may or may not work, and support for these
            is improving with each release.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        R¨   R©   N(   R0   R  R°   RG   R  (   R@   R  RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR/     s    c         O   s   |  j  j | | Ž  S(   sÑ   
        Set z-axis tick locations.
        See :meth:`matplotlib.axes.Axes.set_yticks` for more details.

        .. note::
            Minor ticks are not supported.

        .. versionadded:: 1.1.0
        (   R0   t	   set_ticks(   R@   RC   RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_zticks   s    
c         C   s   |  j  j d | ƒ S(   sà   
        Return the z ticks as a list of locations
        See :meth:`matplotlib.axes.Axes.get_yticks` for more details.

        .. note::
            Minor ticks are not supported.

        .. versionadded:: 1.1.0
        t   minor(   R0   t   get_ticklocs(   R@   R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   get_zticks,  s    
c         C   s   t  j d |  j j ƒ  ƒ S(   sd   
        Get the ztick labels as a list of Text instances

        .. versionadded :: 1.1.0
        s   Text zticklabel(   R   t   silent_listR0   t   get_majorticklabels(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_zmajorticklabels8  s    	c         C   s   t  j d |  j j ƒ  ƒ S(   sÝ   
        Get the ztick labels as a list of Text instances

        .. note::
            Minor ticks are not supported. This function was added
            only for completeness.

        .. versionadded :: 1.1.0
        s   Text zticklabel(   R   R  R0   t   get_minorticklabels(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_zminorticklabelsA  s    
	c         O   s   |  j  j | | Ž  S(   så   
        Set z-axis tick labels.
        See :meth:`matplotlib.axes.Axes.set_yticklabels` for more details.

        .. note::
            Minor ticks are not supported by Axes3D objects.

        .. versionadded:: 1.1.0
        (   R0   t   set_ticklabels(   R@   RC   RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   set_zticklabelsN  s    
c         C   s   t  j d |  j j d | ƒ ƒ S(   sé   
        Get ztick labels as a list of Text instances.
        See :meth:`matplotlib.axes.Axes.get_yticklabels` for more details.

        .. note::
            Minor ticks are not supported.

        .. versionadded:: 1.1.0
        s   Text zticklabelR  (   R   R  R0   t   get_ticklabels(   R@   R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_zticklabelsZ  s    
	c         C   s   |  j  j | ƒ d S(   sï  
        Sets up z-axis ticks and labels that treat the z data as dates.

        *tz* is a timezone string or :class:`tzinfo` instance.
        Defaults to rc value.

        .. note::
            This function is merely provided for completeness.
            Axes3D objects do not officially support dates for ticks,
            and so this may or may not work as expected.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        N(   R0   t	   axis_date(   R@   t   tz(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   zaxis_dateg  s    c         C   s   |  j  j ƒ  S(   sä   
        Get ztick lines as a list of Line2D instances.
        Note that this function is provided merely for completeness.
        These lines are re-calculated as the display changes.

        .. versionadded:: 1.1.0
        (   R0   t   get_ticklines(   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_zticklinesx  s    c         O   s   d S(   sa   
        This function is currently not implemented for 3D axes.
        Returns *None*.
        N(   R   (   R@   RC   RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   clabel‚  s    c         C   sU   d |  _  | d k r$ |  j |  _ n	 | |  _ | d k rH |  j |  _ n	 | |  _ d S(   s{  
        Set the elevation and azimuth of the axes.

        This can be used to rotate the axes programatically.

        'elev' stores the elevation angle in the z plane.
        'azim' stores the azimuth angle in the x,y plane.

        if elev or azim are None (default), then the initial value
        is used which was specified in the :class:`Axes3D` constructor.
        i
   N(   RX   R   R   R   R   R   (   R@   R   R   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR$   ‰  s    		c         C   sð  t  j |  j d t  j |  j d } } |  j ƒ  \ } } |  j ƒ  \ } } |  j ƒ  \ } } t j | | | | | | ƒ }	 t  j	 d d d g ƒ }
 |
 d t  j
 | ƒ t  j
 | ƒ |  j } |
 d t  j | ƒ t  j
 | ƒ |  j } |
 d t  j | ƒ |  j } t  j	 | | | f ƒ } | |  _ |
 | |  _ |  j t j |  j ƒ |  _ t | ƒ t  j d k r~t  j	 d ƒ } n t  j	 d ƒ } |  j |  j } } t j | |
 | ƒ } t j | | ƒ } t  j | |	 ƒ } t  j | | ƒ } | S(	   s  
        Create the projection matrix from the current viewing position.

        elev stores the elevation angle in the z plane
        azim stores the azimuth angle in the x,y plane

        dist is the distance of the eye viewing point from the object
        point.

        i´   g      à?i    i   i   iÿÿÿÿ(   i    i    iÿÿÿÿ(   i    i    i   (   R
   t   piR   R   Ré   Rê   Rë   Rz   t   world_transformationR   t   cosRX   t   sinRˆ   R‡   t   modt   abst   view_transformationt   persp_transformationt   dot(   R@   t   relevt   razimRí   Rî   R  R  R  R  t   worldMt   Rt   xpt   ypt   zpt   Et   Vt   zfrontt   zbackt   viewMt   perspMt   M0R-   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR†   ¢  s0    )++	i   i   c         C   sª   d |  _ |  j j } | d k	 ru | j d |  j ƒ } | j d |  j ƒ } | j d |  j ƒ } | | | g |  _ n t	 j
 d ƒ t j | ƒ |  _ t j | ƒ |  _ d S(   s"  Initializes mouse button callbacks to enable 3D rotation of
        the axes.  Also optionally sets the mouse buttons for 3D rotation
        and zooming.

        ============  =======================================================
        Argument      Description
        ============  =======================================================
        *rotate_btn*  The integer or list of integers specifying which mouse
                      button or buttons to use for 3D rotation of the axes.
                      Default = 1.

        *zoom_btn*    The integer or list of integers specifying which mouse
                      button or buttons to use to zoom the 3D axes.
                      Default = 3.
        ============  =======================================================

        t   motion_notify_eventt   button_press_eventt   button_release_eventsc   Axes3D.figure.canvas is 'None', mouse rotation disabled.  Set canvas then call Axes3D.mouse_init().N(   R   t   button_pressedR>   Rù   t   mpl_connectt   _on_movet   _button_presst   _button_releaseR   Rõ   Rö   R
   t
   atleast_1dt   _rotate_btnt	   _zoom_btn(   R@   t
   rotate_btnt   zoom_btnt   canvt   c1t   c2t   c3(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR5   Ñ  s    	c         C   s   t  S(   s‘   
        Return *True* if this axes supports the zoom box button functionality.

        3D axes objects do not use the zoom box button.
        (   RG   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   can_zoomð  s    c         C   s   t  S(   s‘   
        Return *True* if this axes supports the pan/zoom button functionality.

        3D axes objects do not use the pan/zoom button.
        (   RG   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   can_panø  s    c         C   sÚ   |  j  j ƒ  |  j d k	 r– |  j j  j |  j  _ |  j j  j |  j  _ |  j j ƒ  \ } } |  j | | d t d d ƒ|  j  j	 |  j j  j
 ƒ  ƒ n |  j  j	 d ƒ t |  _ d |  _ t j |  ƒ |  j t d ƒ d S(   s   
        Clear axes
        Rñ   RW   t   lineari    s   axes3d.gridN(   R0   t   claR&   R   t   majorR  R  R  RG   R  R  R*   Rž   R¤   R   t   gridR   (   R@   Ræ   Rç   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRW     s    		c         C   s4   x$ |  j  D] } |  j j j | ƒ q
 Wg  |  _  d S(   s(   Disable mouse button callbacks.
        N(   R   R>   Rù   t   mpl_disconnect(   R@   t   cid(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   disable_mouse_rotation  s    c         C   s;   | j  |  k r7 | j |  _ | j | j |  _ |  _ n  d  S(   N(   t   inaxest   buttonRF  RO   RP   t   sxt   sy(   R@   t   event(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRI  "  s    c         C   s   d  |  _ d  S(   N(   R   RF  (   R@   Ra  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRJ  '  s    c         C   sN   y |  j  | ƒ SWn6 t t f k
 rI |  j j ƒ  j } | | ƒ } | SXd S(   sº   
        Return *z* string formatted.  This function will use the
        :attr:`fmt_zdata` attribute if it is callable, else will fall
        back on the zaxis major formatter
        N(   R.   RÀ   t	   TypeErrorR0   t   get_major_formattert   format_data_short(   R@   RM   t   funct   val(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   format_zdata*  s     c         C   s‘  |  j  d k r d S|  j |  j k r9 d |  j |  j f S| | f } |  j ƒ  } g  t | ƒ D]- \ } \ } } t j	 | | | ƒ | f ^ q^ } | j
 ƒ  | d d }	 | |	 \ } } | \ }
 } } | \ } } } t j |
 | | | ƒ } t j | | | | ƒ } | | } | | | | | | } t j | | | |  j  ƒ \ } } } |  j | ƒ } |  j | ƒ } |  j | ƒ } d | | | f S(   så   
        Given the 2D view coordinates attempt to guess a 3D coordinate.
        Looks for the nearest edge to the point and then assumes that
        the point is at the same z location as the nearest point on the edge.
        t    s!   azimuth=%d deg, elevation=%d deg i    i   s   x=%s, y=%s, z=%sN(   R-   R   RF  RL  R   R   R�   R�   Rz   t   line2d_seg_distRŒ   R
   t   hypott   inv_transformt   format_xdatat   format_ydataRg  (   R@   t   xdt   ydt   pR€   R”   t   p0t   p1t   ldistst   edgeiRÝ   Râ   Ræ   RÞ   Rã   Rç   t   d0t   d1t   dtRM   RE   R_   Rv   Rw   Rx   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   format_coord6  s,    =

$c         C   så  |  j  s d S|  j d k r  d S| j | j } } | d k rC d S| |  j | |  j } } |  j } |  j } | | |  _ |  _ |  j  |  j	 k r| d k r± | d k r± d St
 j |  j | | d ƒ |  _ t
 j |  j | | d ƒ |  _ |  j ƒ  |  j j j ƒ  nÑ |  j  |  j k rá|  j ƒ  \ } }	 }
 } } } d | | | } |	 | | } | |
 | } | | | } |  j | | |	 | ƒ |  j |
 | | | ƒ |  j | | | | ƒ |  j ƒ  |  j j j ƒ  n  d S(   s®   Mouse moving

        button-1 rotates by default.  Can be set explicitly in mouse_init().
        button-3 zooms by default.  Can be set explicitly in mouse_init().
        Ni    i´   i   (   RF  R-   R   RO   RP   R_  R`  R<   R=   RL  t   art3dt
   norm_angleR   R   R†   R>   Rù   Rú   RM  Rm   R   R
  R  (   R@   Ra  RE   R_   t   dxt   dyt   wt   hRp   Rq   Rr   Rs   Rt   Ru   t   dft   dz(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRH  ^  s:    			!!
	
c         K   s1   | d k	 r | |  j _ n  |  j j | | | � S(   sª   
        Set zlabel.  See doc for :meth:`set_ylabel` for description.

        .. note::
            Currently, *labelpad* does not have an effect on the labels.
        N(   R   R0   t   labelpadt   set_label_text(   R@   t   zlabelt   fontdictR�  RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   set_zlabel•  s    	 c         C   s   |  j  j ƒ  } | j ƒ  S(   s�   
        Get the z-label text string.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        (   R0   t	   get_labelt   get_text(   R@   t   label(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   get_zlabel¡  s    c         C   s   |  j  S(   s\   
        Get whether the 3D axes panels are drawn

        .. versionadded :: 1.1.0
        (   R…   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_frame_on­  s    c         C   s   t  | ƒ |  _ d S(   sƒ   
        Set whether the 3D axes panels are drawn

        ACCEPTS: [ *True* | *False* ]

        .. versionadded :: 1.1.0
        N(   R·   R…   (   R@   R¡   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   set_frame_onµ  s    c         C   s   t  S(   sÈ   
        Get whether axis below is true or not.

        For axes3d objects, this will always be *True*

        .. versionadded :: 1.1.0
            This function was added for completeness.
        (   R*   (   R@   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_axisbelow¿  s    	c         C   s   t  |  _ d S(   s0  
        Set whether the axis ticks and gridlines are above or below
        most artists

        For axes3d objects, this will ignore any settings and just use *True*

        ACCEPTS: [ *True* | *False* ]

        .. versionadded :: 1.1.0
            This function was added for completeness.
        N(   R*   t
   _axisbelow(   R@   R¡   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   set_axisbelowÊ  s    c         K   s+   t  | ƒ r t } n  t j | ƒ |  _ d S(   sa  
        Set / unset 3D grid.

        .. note::

            Currently, this function does not behave the same as
            :meth:`matplotlib.axes.Axes.grid`, but it is intended to
            eventually support that behavior.

        .. versionchanged :: 1.1.0
            This function was changed, but not tested. Please report any bugs.
        N(   R­   R*   t   maxest   _string_to_boolt
   _draw_grid(   R@   R¡   RD   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRY  Ø  s    	c   
      K   s·  | j  d d ƒ j ƒ  } | j  d d ƒ } | j  d d ƒ } | j  d d ƒ j ƒ  } | d k	 r¥ y | \ } } | | d Wq¥ t t f k
 r¡ t d ƒ ‚ q¥ Xn  | d	  d
 k r¾ t } nW | d k r÷ t } | d k rå t }	 qt }	 t d ‚ n | d k rd } n	 t d ‚ y~| d k	 r–| d k rI|  j j	 j
 j | ƒ n  | d k rn|  j j	 j
 j | ƒ n  | d k r–|  j j	 j
 j | ƒ q–n  | d k	 r| d k rÇ|  j j	 j
 j | ƒ n  | d k rì|  j j	 j
 j | ƒ n  | d k r|  j j	 j
 j | ƒ qn  | d k	 r’| d k rE|  j j	 j
 j | ƒ n  | d k rj|  j j	 j
 j | ƒ n  | d k r’|  j j	 j
 j | ƒ q’n  Wn t k
 r²t d ƒ ‚ n Xd S(   s$  
        Convenience method for manipulating the ScalarFormatter
        used by default for linear axes in Axed3D objects.

        See :meth:`matplotlib.axes.Axes.ticklabel_format` for full
        documentation.  Note that this version applies to all three
        axes of the Axes3D object.  Therefore, the *axis* argument
        will also accept a value of 'z' and the value of 'both' will
        apply to all three axes.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        t   styleRh  t	   scilimitst	   useOffsetR»   R¶   i   s*   scilimits must be a sequence of 2 integersi   t   scit   plaint   commas   comma style remains to be addeds   %s is not a valid style valueRM   R_   RE   s0   This method only works with the ScalarFormatter.N(   R–  s   comma(   s   bothRM   (   s   bothR_   (   s   bothRM   (   s   bothRE   (   s   bothR_   (   s   bothRM   (   s   bothRE   (   s   bothR_   (   s   bothRM   (   R   t   lowerR   R£   Rb  R*   RG   t   NotImplementedErrorRI   RX  t	   formattert   set_scientificRK   R0   t   set_powerlimitst   set_useOffsetRÀ   (
   R@   RD   R’  R“  R”  R»   R¥   t   nt   sbt   cb(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   ticklabel_formatê  s\    				 c      	   K   s§   | d
 k } | d k } | d k } | rC |  j  j ƒ  j | �  n  | rb |  j j ƒ  j | �  n  | r� |  j j ƒ  j | �  n  |  j d | d | d | d | ƒ d	 S(   sÿ  
        Convenience method for controlling tick locators.

        See :meth:`matplotlib.axes.Axes.locator_params` for full
        documentation  Note that this is for Axes3D objects,
        therefore, setting *axis* to 'both' will result in the
        parameters being set for all three axes.  Also, *axis*
        can also take a value of 'z' to apply parameters to the
        z axis.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        RE   R¶   R_   RM   R§   R¨   R©   Rª   N(   RE   s   both(   R_   s   both(   RM   s   both(   RI   RÓ   t
   set_paramsRK   R0   R°   (   R@   R»   R§   RD   t   _xt   _yt   _z(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   locator_params)  s    c         K   s‚   t  j |  | | � | d k r~ t | ƒ } | j d d ƒ | j d d ƒ | j d d ƒ | j d d ƒ |  j j | �  n  d S(	   s(  
        Convenience method for changing the appearance of ticks and
        tick labels.

        See :meth:`matplotlib.axes.Axes.tick_params` for more complete
        documentation.

        The only difference is that setting *axis* to 'both' will
        mean that the settings are applied to all three axes. Also,
        the *axis* parameter also accepts a value of 'z', which
        would mean to apply to only the z-axis.

        Also, because of how Axes3D objects are drawn very differently
        from regular 2D axes, some of these settings may have
        ambiguous meaning.  For simplicity, the 'z' axis will
        accept settings as if it was like the 'y' axis.

        .. note::
            While this function is currently implemented, the core part
            of the Axes3D object may ignore some of these settings.
            Future releases will fix this. Priority will be given to
            those who file bugs.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        RM   R¶   R  R  t   labeltopt   labelbottomN(   RM   s   both(   R   t   tick_paramst   dictR   R   R0   t   set_tick_params(   R@   R»   RD   t   zkw(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR©  B  s    c         C   s,   |  j  ƒ  \ } } |  j | | d d ƒd S(   s“   
        Invert the z-axis.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        RW   N(   R  R  R   (   R@   R  R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   invert_zaxish  s    c         C   s   |  j  ƒ  \ } } | | k  S(   s¨   
        Returns True if the z-axis is inverted.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        (   R  (   R@   R  R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   zaxis_invertedr  s    c         C   s6   |  j  ƒ  \ } } | | k  r( | | f S| | f Sd S(   sÏ   
        Returns the z-axis numerical bounds where::

          lowerBound < upperBound

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        N(   R  (   R@   R  R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt
   get_zbound|  s    	
c         C   sï   | d k r* t j | ƒ r* | \ } } n  |  j ƒ  \ } } | d k rQ | } n  | d k rf | } n  |  j ƒ  r° | | k  r— |  j | | d d ƒqë |  j | | d d ƒn; | | k  rÕ |  j | | d d ƒn |  j | | d d ƒd S(   sE  
        Set the lower and upper numerical bounds of the z-axis.
        This method will honor axes inversion regardless of parameter order.
        It will not change the :attr:`_autoscaleZon` attribute.

        .. versionadded :: 1.1.0
            This function was added, but not tested. Please report any bugs.
        RW   N(   R   R   Rì   R¯  R®  R  (   R@   R˜  t   uppert	   old_lowert	   old_upper(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRÙ   ‹  s    	 	 	c         K   s2   t  j |  | | | | � } t j | | | ƒ | S(   sµ   
        Add text to the plot. kwargs will be passed on to Axes.text,
        except for the `zdir` keyword, which sets the direction to be
        used as the z direction.
        (   R   t   textRy  t   text_2d_to_3d(   R@   RE   R_   RM   t   st   zdirRD   R³  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR³  ©  s    c         O   sˆ  |  j  ƒ  } | j d d ƒ } | j d d ƒ } d } t | ƒ d k r¾ t j | d ƒ r¾ t | ƒ t | d ƒ k r¾ t | d ƒ d k s¤ t j | d d ƒ rú | | } | d 7} qú n< t | ƒ d k rú t j | d ƒ rú | | } | d 7} n  t j | ƒ s%t j t | ƒ ƒ | } n  t j	 |  | | | | | Ž }	 x' |	 D] }
 t
 j |
 d | d | ƒqKW|  j | | | | ƒ |	 S(   so  
        Plot 2D or 3D data.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *xs*, *ys*  X, y coordinates of vertices

        *zs*        z value(s), either one for all points or one for
                    each point.
        *zdir*      Which direction to use as z ('x', 'y' or 'z')
                    when plotting a 2D set.
        ==========  ================================================

        Other arguments are passed on to
        :func:`~matplotlib.axes.Axes.plot`
        Rx   i    R¶  RM   i   (   t   has_dataR   R­   R   Rì   t	   is_scalarR
   t   onesR   t   plotRy  t   line_2d_to_3dRÇ   (   R@   Rv   Rw   RC   RD   RÆ   Rx   R¶  t   argsiRÌ   t   line(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRº  ¶  s&    %-
%
c   ,   
   O   s  |  j  ƒ  } t j | ƒ } t j | | | ƒ \ } } } | j \ } } | j d d ƒ }	 | j d d ƒ }
 d | k rŠ | j d ƒ } n* t j t j | j d d ƒ ƒ ƒ } d } | j
 d d ƒ } | j d d ƒ } | j d	 d ƒ } | j d
 d ƒ } | j
 d d ƒ } | j d | d k ƒ } | j d d ƒ } | rn| d k	 rn| d k	 rn|  j | | | ƒ } n  g  } | d k r÷| r÷t t j t | d ƒ |	 ƒ t j t | d ƒ |
 ƒ ƒ } t j | d f ƒ } t j | d f ƒ } d } n  g  } xØt d | d |	 ƒ D]À} x·t d | d |
 ƒ D]Ÿ} g  } x!| | | f D]} | | | t | | |
 d ƒ … f } | | d t | | |	 d ƒ … t | d | |
 ƒ f } | t | d | |	 ƒ | t | | |
 d ƒ d … f d d d … }  | | t | d | |	 ƒ d … | f d d d … }! t j | | |  |! f ƒ }" | j |" ƒ qMWt | Œ  } t j g  ƒ }# | d g g  t d t | ƒ ƒ D]( }$ | |$ | |$ d k rœ| |$ ^ qœ}% t d „  |% Dƒ ƒ }& | j |% ƒ | d k	 r| j | | | ƒ n | j |& t |% ƒ ƒ | d k r1| r1d t t |% ƒ d ƒ t d t |% ƒ d ƒ }' }( }) t j |% |' ƒ t j |% |( ƒ | | <t j |% |( ƒ t j |% |) ƒ | | <| d 7} q1q1WqW| d k rÿ| rÿt j | | ƒ }* n g  }* t j | | | Ž }+ | d k	 r^| rA|  j | |* ƒ } n  |+ j | ƒ |+ j | ƒ nš | rÊt j | ƒ } |+ j | ƒ | d k	 s˜| d k	 r«|+ j | | ƒ n  | d k	 rø|+ j | ƒ qøn. | rå|  j | |* ƒ } n | } |+ j | ƒ |  j  |+ ƒ |  j! | | | | ƒ |+ S(   s5  
        Create a surface plot.

        By default it will be colored in shades of a solid color,
        but it also supports color mapping by supplying the *cmap*
        argument.

        ============= ================================================
        Argument      Description
        ============= ================================================
        *X*, *Y*, *Z* Data values as 2D arrays
        *rstride*     Array row stride (step size)
        *cstride*     Array column stride (step size)
        *color*       Color of the surface patches
        *cmap*        A colormap for the surface patches.
        *facecolors*  Face colors for the individual patches
        *norm*        An instance of Normalize to map values to colors
        *vmin*        Minimum value to map
        *vmax*        Maximum value to map
        *shade*       Whether to shade the facecolors
        ============= ================================================

        Other arguments are passed on to
        :class:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
        t   rstridei
   t   cstridet
   facecolorst   colorR¡   t   cmapt   normt   vmint   vmaxt	   linewidtht   shadet   lightsourcei   i   i    Niÿÿÿÿc         s   s   |  ] } | d  Vq d S(   i   N(    (   t   .0Rp  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pys	   <genexpr>G  s    i   ("   R·  R
   t
   atleast_2dt   broadcast_arrayst   shapeR   R   R   t   to_rgbaR   t   gett   _shade_colors_lightsourcet   intt   ceilt   floatt   emptyt   xranget   mint   concatenatet   appendRn   R­   t   sumt   crossRy  t   Poly3DCollectiont   _shade_colorst   set_facecolorst   set_edgecolorst	   set_arrayt   set_climt   set_normt   add_collectionRÇ   (,   R@   RÃ   RÄ   RÅ   RC   RD   RÆ   t   rowst   colsR¾  R¿  t   fcolorsRÁ  RÂ  RÃ  RÄ  RÅ  RÆ  RÇ  RÈ  t   polyst   totptst   v1t   v2t   which_ptt   colsett   rst   cst   pst   at   ztopt   zleftt   zbaset   zrightRM   t   lastpR”   t   ps2t   avgzsumt   i1t   i2t   i3t   normalst   polyc(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   plot_surfaceò  s”    $!	'!H7O8((c         C   s|   g  } xo | D]g } t  j | d ƒ t  j | d ƒ } t  j | d ƒ t  j | d ƒ } | j t  j | | ƒ ƒ q W| S(   sÊ   
        Generate normals for polygons by using the first three points.
        This normal of course might not make sense for polygons with
        more than three points not lying in a plane.
        i    i   i   (   R
   R   R×  RÙ  (   R@   t   polygonsRù  t   vertsRç  Rè  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   _generate_normalst  s    $$c   	      C   s  t  j g  | D]. } t  j | t j | ƒ d d d g ƒ ^ q ƒ } t  j | ƒ } t | | ƒ d k rö t t | | ƒ t	 | | ƒ ƒ } t
 j | ƒ } | d d … d f } d | | ƒ d d … t  j f d | } | | d d … d f <n t  j | ƒ j ƒ  } | S(   sŽ   
        Shade *color* using normal vectors given by *normals*.
        *color* can also be an array of the same length as *normals*.
        iÿÿÿÿg      à?i    Ni   (   R
   R   R4  Rz   R0  t   isnanR­   R   RÕ  t   maxR   t   to_rgba_arrayt   newaxist
   asanyarrayt   copy(	   R@   RÁ  Rù  Rž  RÇ  t   maskRÃ  t   alphat   colors(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRÛ  ‚  s    	;#+c         C   s4   | d  k r$ t d d d d ƒ } n  | j | | ƒ S(   Nt   azdegi‡   t   altdegi7   (   R   R	   RÇ  (   R@   t   dataRÂ  RÈ  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRÏ  š  s    c         O   s§  | j  d d ƒ } | j  d d ƒ } |  j ƒ  } t j | ƒ } t j | | | ƒ \ } } } | j \ }	 }
 t j | ƒ t j | ƒ t j | ƒ } } } t d |	 | ƒ } t d |
 | ƒ } |	 d k ró | d |	 d k ró | |	 d g 7} n  |
 d k r'| d |
 d k r'| |
 d g 7} n  | j d k rEg  } g  } n  g  | D] } | | ^ qL} g  | D] } | | ^ qi} g  | D] } | | ^ q†} g  | D] } | | ^ q£} g  | D] } | | ^ qÀ} g  | D] } | | ^ qÝ} g  t	 | | | ƒ D]! \ } } } t	 | | | ƒ ^ q} | g  t	 | | | ƒ D]! \ } } } t	 | | | ƒ ^ qC7} t
 j | | | Ž } |  j | ƒ |  j | | | | ƒ | S(   sb  
        Plot a 3D wireframe.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as 2D arrays
        *Z*
        *rstride*   Array row stride (step size)
        *cstride*   Array column stride (step size)
        ==========  ================================================

        Keyword arguments are passed on to
        :class:`~matplotlib.collections.LineCollection`.

        Returns a :class:`~mpl_toolkits.mplot3d.art3d.Line3DCollection`
        R¾  i   R¿  i    iÿÿÿÿ(   R   R·  R
   RÊ  RË  RÌ  t	   transposet   ranget   sizeRn   Ry  t   Line3DCollectionRá  RÇ   (   R@   RÃ   RÄ   RÅ   RC   RD   R¾  R¿  RÆ   Râ  Rã  t   tXt   tYt   tZt   riit   ciiR”   t   xlinest   ylinest   zlinest   txlinest   tylinest   tzlinest   xlt   ylt   zlRÌ   t   linec(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   plot_wireframeŸ  s<    /  	78c         O   sª  |  j  ƒ  } t j t j | j d d ƒ ƒ ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ }	 | j d | d k ƒ }
 | j d	 d ƒ } t j	 | | Ž  \ } } } t j
 | d
 ƒ } | j ƒ  } | j | d t j f } | j | d t j f } t j | ƒ | d t j f } t j | | | f d d ƒ} | d k r±|
 r±t | ƒ } t j | d f ƒ } t j | d f ƒ } d
 } n  g  } xç t t | ƒ ƒ D]Ó } | | d
 d f | | d d f | | d d f } | j | d ƒ | d k rÊ|
 rÊt j | | d
 f ƒ t j | | d f ƒ | | <t j | | d f ƒ t j | | d f ƒ | | <| d 7} qÊqÊW| d k rÈ|
 rÈt j | | ƒ } n g  } t j | | | Ž } | rOt j | ƒ } | j | ƒ | d k	 s| d k	 r0| j | | ƒ n  | d k	 r}| j | ƒ q}n. |
 rj|  j | | ƒ } n | } | j | ƒ |  j | ƒ |  j | j | j | | ƒ | S(   sƒ  
        ============= ================================================
        Argument      Description
        ============= ================================================
        *X*, *Y*, *Z* Data values as 1D arrays
        *color*       Color of the surface patches
        *cmap*        A colormap for the surface patches.
        *norm*        An instance of Normalize to map values to colors
        *vmin*        Minimum value to map
        *vmax*        Maximum value to map
        *shade*       Whether to shade the facecolors
        ============= ================================================

        The (optional) triangulation can be specified in one of two ways;
        either::

          plot_trisurf(triangulation, ...)

        where triangulation is a :class:`~matplotlib.tri.Triangulation`
        object, or::

          plot_trisurf(X, Y, ...)
          plot_trisurf(X, Y, triangles, ...)
          plot_trisurf(X, Y, triangles=triangles, ...)

        in which case a Triangulation object will be created.  See
        :class:`~matplotlib.tri.Triangulation` for a explanation of
        these possibilities.

        The remaining arguments are::

          plot_trisurf(..., Z)

        where *Z* is the array of values to contour, one per point
        in the triangulation.

        Other arguments are passed on to
        :class:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`

        **Examples:**

        .. plot:: mpl_examples/mplot3d/trisurf3d_demo.py
        .. plot:: mpl_examples/mplot3d/trisurf3d_demo2.py

        .. versionadded:: 1.2.0
            This plotting function was added for the v1.2.0 release.
        RÁ  R¡   RÂ  RÃ  RÄ  RÅ  RÆ  RÇ  RÈ  i    .R»   i   i   i   g      @N(   R·  R
   R   R   RÍ  R   RÎ  R   R   t   get_from_args_and_kwargsR¾   t   get_masked_trianglesRE   R  R_   RÖ  R­   RÓ  RÔ  R×  RÙ  Ry  RÚ  RÞ  Rß  Rà  RÛ  RÜ  Rá  RÇ   (   R@   RC   RD   RÆ   RÁ  RÂ  RÃ  RÄ  RÅ  RÆ  RÇ  RÈ  t   triRM   t	   trianglest   xtt   ytt   ztRý  Ræ  Rç  Rè  Ré  Rê  R”   Rõ  Rù  Rú  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   plot_trisurfâ  s^    1$ 	544i   c         C   s‚  | j  } | j } | d | d d } x2t | | ƒ D]!\ } } t j | j ƒ  | | ƒ } t j | j ƒ  | | ƒ }	 | j ƒ  d }
 g  } g  } t t | d ƒ | ƒ } | d k rã t | d ƒ d k r8 d } qã q8 n  t | d ƒ d | d } xþ t	 t
 t | ƒ ƒ d ƒ D]à } t
 t | | ƒ ƒ } t
 t | d | ƒ ƒ } | j | d | | d | |	 d | |	 d | g ƒ t j | d | ƒ t j | d | ƒ } t j | d | ƒ t j |	 d | ƒ } | j t j | | ƒ ƒ qW|  j |
 | ƒ } |  j |
 | ƒ } t j | d | d | ƒ} | j | ƒ |  j | ƒ q8 Wx | D] } |  j j | ƒ qdWd S(   s4   
        Extend a contour in 3D by creating
        i   i    i   RÀ  t
   edgecolorsN(   t   levelsRŠ   Rn   Ry  t   paths_to_3d_segmentst	   get_pathst	   get_colort   roundR­   R  RÐ  R×  R
   R   RÙ  RÛ  RÚ  t   set_sort_zpost   add_collection3dt   remove(   R@   t   csett   strideR(  t   collsR€  RM   R  t   topvertst   botvertsRÁ  t	   polyvertsRù  t   nstepst   stepsizeR”   Rö  R÷  Rç  Rè  R  t   colors2t   polycolR’   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   _3d_extend_contourW  sD    			#,,	RM   c         C   sx   d | } | r# |  j  | | ƒ nQ xN t | j | j ƒ D]7 \ } } | d  k	 rZ | } n  t j | | d | ƒq9 Wd  S(   Nt   -R¶  (   R:  Rn   R(  RŠ   R   Ry  t   line_collection_2d_to_3d(   R@   R0  t   extend3dR1  R¶  t   offsetRM   R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   add_contour_set‡  s    
"	c         C   sl   d | } x[ t  | j | j ƒ D]D \ } } | d  k	 rA | } n  t j | | d | ƒ| j | ƒ q  Wd  S(   NR;  R¶  (   Rn   R(  RŠ   R   Ry  t   poly_collection_2d_to_3dR-  (   R@   R0  R¶  R>  RM   R  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   add_contourf_set‘  s    
"	c         O   sÆ   | j  d t ƒ } | j  d d ƒ } | j  d d ƒ } | j  d d ƒ }	 |  j ƒ  }
 t j | | | | ƒ \ } } } t j |  | | | | | Ž } |  j | | | | |	 ƒ |  j	 | | | |
 ƒ | S(   sI  
        Create a 3D contour plot.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as numpy.arrays
        *Z*
        *extend3d*  Whether to extend contour in 3D (default: False)
        *stride*    Stride (step size) for extending contour
        *zdir*      The direction to use: x, y or z (default)
        *offset*    If specified plot a projection of the contour
                    lines on this position in plane normal to zdir
        ==========  ================================================

        The positional and other keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.contour`

        Returns a :class:`~matplotlib.axes.Axes.contour`
        R=  R1  i   R¶  RM   R>  N(
   R   RG   R   R·  Ry  t   rotate_axesR   t   contourR?  RÇ   (   R@   RÃ   RÄ   RÅ   RC   RD   R=  R1  R¶  R>  RÆ   t   jXt   jYt   jZR0  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRC  ™  s    !c         O   sÆ   | j  d t ƒ } | j  d d ƒ } | j  d d ƒ } | j  d d ƒ }	 |  j ƒ  }
 t j | | | | ƒ \ } } } t j |  | | | | | Ž } |  j | | | | |	 ƒ |  j	 | | | |
 ƒ | S(   sZ  
        Create a 3D contour plot.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as numpy.arrays
        *Z*
        *extend3d*  Whether to extend contour in 3D (default: False)
        *stride*    Stride (step size) for extending contour
        *zdir*      The direction to use: x, y or z (default)
        *offset*    If specified plot a projection of the contour
                    lines on this position in plane normal to zdir
        ==========  ================================================

        Other keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.tricontour`

        Returns a :class:`~matplotlib.axes.Axes.contour`

        .. versionadded:: 1.1.0
        R=  R1  i   R¶  RM   R>  N(
   R   RG   R   R·  Ry  RB  R   t
   tricontourR?  RÇ   (   R@   RÃ   RÄ   RÅ   RC   RD   R=  R1  R¶  R>  RÆ   RD  RE  RF  R0  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRG  ¿  s    !c         O   sœ   | j  d d ƒ } | j  d d ƒ } |  j ƒ  } t j | | | | ƒ \ }	 }
 } t j |  |	 |
 | | | Ž } |  j | | | ƒ |  j | | | | ƒ | S(   s   
        Create a 3D contourf plot.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as numpy.arrays
        *Z*
        *zdir*      The direction to use: x, y or z (default)
        *offset*    If specified plot a projection of the filled contour
                    on this position in plane normal to zdir
        ==========  ================================================

        The positional and keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.contourf`

        Returns a :class:`~matplotlib.axes.Axes.contourf`

        .. versionchanged :: 1.1.0
            The *zdir* and *offset* kwargs were added.
        R¶  RM   R>  N(	   R   R   R·  Ry  RB  R   t   contourfRA  RÇ   (   R@   RÃ   RÄ   RÅ   RC   RD   R¶  R>  RÆ   RD  RE  RF  R0  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRH  å  s    !c         O   sœ   | j  d d ƒ } | j  d d ƒ } |  j ƒ  } t j | | | | ƒ \ }	 }
 } t j |  | | | | | Ž } |  j | | | ƒ |  j | | | | ƒ | S(   sÚ  
        Create a 3D contourf plot.

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *X*, *Y*,   Data values as numpy.arrays
        *Z*
        *zdir*      The direction to use: x, y or z (default)
        *offset*    If specified plot a projection of the contour
                    lines on this position in plane normal to zdir
        ==========  ================================================

        Other keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.tricontour`

        Returns a :class:`~matplotlib.axes.Axes.contour`

        .. versionadded :: 1.1.0
        R¶  RM   R>  N(	   R   R   R·  Ry  RB  R   t   tricontourfRA  RÇ   (   R@   RÃ   RÄ   RÅ   R>  R¶  RC   RD   RÆ   RD  RE  RF  R0  (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRI  
  s    !i    c         C   s  t  j | ƒ } t | ƒ d k r0 t | ƒ } n d } t | ƒ t j k rt t j | d | d | ƒ| j	 | ƒ n| t | ƒ t j
 k r² t j | d | d | ƒ| j	 | ƒ n> t | ƒ t j k rð t j | d | d | ƒ| j	 | ƒ n  t j |  | ƒ d S(   s)  
        Add a 3D collection object to the plot.

        2D collection types are converted to a 3D version by
        modifying the object and adding z coordinate information.

        Supported are:
            - PolyCollection
            - LineColleciton
            - PatchCollection
        i    Rx   R¶  N(   R
   RK  R­   RÕ  t   typet   mcollt   PolyCollectionRy  R@  R-  t   LineCollectionR<  t   PatchCollectiont   patch_collection_2d_to_3dR   Rá  (   R@   R’   Rx   R¶  t   zvalst   zsortval(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR.  +  s    i   R¡   c      
   O   s  |  j  ƒ  }	 t j j | ƒ } t j j | ƒ } t j j | ƒ } | j | j k rc t d ƒ ‚ n  | j | j k r¯ | j d k r  t j | d | j ƒ } q¯ t d ƒ ‚ n  t j j | ƒ } t j | ƒ pÜ t j	 | ƒ }
 |
 st j
 | ƒ } | j | j k rt j j | ƒ } qn  t j | | | | | ƒ \ } } } } } t j |  | | d | d | | | Ž} t j | ƒ s t } t j t | ƒ ƒ | } n t } t j | d | d | ƒ|  j d	 k  rí| j d k rí|  j d	 ƒ n  | s|  j | | | |	 ƒ n  | S(
   sô  
        Create a scatter plot.

        ==========  ==========================================================
        Argument    Description
        ==========  ==========================================================
        *xs*, *ys*  Positions of data points.
        *zs*        Either an array of the same length as *xs* and
                    *ys* or a single value to place all points in
                    the same plane. Default is 0.
        *zdir*      Which direction to use as z ('x', 'y' or 'z')
                    when plotting a 2D set.
        *s*         size in points^2.  It is a scalar or an array of the same
                    length as *x* and *y*.

        *c*         a color. *c* can be a single color format string, or a
                    sequence of color specifications of length *N*, or a
                    sequence of *N* numbers to be mapped to colors using the
                    *cmap* and *norm* specified via kwargs (see below). Note
                    that *c* should not be a single numeric RGB or RGBA
                    sequence because that is indistinguishable from an array
                    of values to be colormapped.  *c* can be a 2-D array in
                    which the rows are RGB or RGBA, however.
        ==========  ==========================================================

        Keyword arguments are passed on to
        :func:`~matplotlib.axes.Axes.scatter`.

        Returns a :class:`~mpl_toolkits.mplot3d.art3d.Patch3DCollection`
        s-   Arguments 'xs' and 'ys' must be of same size.i   i    sA   Argument 'zs' must be of same size as 'xs' and 'ys' or of size 1.Rµ  t   cRx   R¶  gš™™™™™©?(   R·  R
   t   mat   ravelR  R£   t   tileR   t   is_string_liket   is_sequence_of_stringsR  t   delete_masked_pointsR   t   scatterRì   R*   R¹  R­   RG   Ry  RO  R¤   R¦   RÇ   (   R@   Rv   Rw   Rx   R¶  Rµ  RR  RC   RD   RÆ   t   cstrR�   t   is_2d(    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRY  L  s8     *'c         O   sV  |  j  ƒ  } t j |  | | | | Ž } t j | ƒ sR t j t | ƒ ƒ | } n  g  }	 g  }
 x† t | | ƒ D]u \ } } t	 j
 | ƒ } |	 | j ƒ  7}	 |
 | g t | ƒ 7}
 t	 j | | | ƒ d | k rn | j | d ƒ qn qn Wt |	 ƒ d k rt |	 Œ  \ } } n g  g  } } t	 j | | |
 | ƒ \ } } }
 |  j | | |
 | ƒ | S(   s  
        Add 2D bar(s).

        ==========  ================================================
        Argument    Description
        ==========  ================================================
        *left*      The x coordinates of the left sides of the bars.
        *height*    The height of the bars.
        *zs*        Z coordinate of bars, if one value is specified
                    they will all be placed at the same z.
        *zdir*      Which direction to use as z ('x', 'y' or 'z')
                    when plotting a 2D set.
        ==========  ================================================

        Keyword arguments are passed onto :func:`~matplotlib.axes.Axes.bar`.

        Returns a :class:`~mpl_toolkits.mplot3d.art3d.Patch3DCollection`
        R  i    (   R·  R   t   barR   Rì   R
   R¹  R­   Rn   Ry  t   get_patch_vertst   tolistt   patch_2d_to_3dt	   set_alphat   juggle_axesRÇ   (   R@   Rû   t   heightRx   R¶  RC   RD   RÆ   R�   Rý  t   verts_zsRp  RM   t   vsRv   Rw   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR\  —  s&    !t   averagec	         O   s  |  j  ƒ  } t j | ƒ s' | g } n  t j | ƒ sB | g } n  t j | ƒ s] | g } n  t j | ƒ sx | g } n  t j | ƒ s“ | g } n  t j | ƒ s® | g } n  t | ƒ d k rÓ | t | ƒ } n  t | ƒ d k rø | t | ƒ } n  t | ƒ d k r| t | ƒ } n  t | ƒ t | ƒ k sMt | ƒ t | ƒ k r]t j d ƒ n  d	 \ } } } d
 \ } } } g  } xjt | | | | | | ƒ D]M\ } } } } } } t | | ƒ } t | | | ƒ } t | | ƒ } t | | | ƒ } t | | ƒ } t | | | ƒ } | j	 | | | f | | | | f | | | | | f | | | | f f | | | | f | | | | | f | | | | | | f | | | | | f f | | | f | | | | f | | | | | f | | | | f f | | | | f | | | | | f | | | | | | f | | | | | f f | | | f | | | | f | | | | | f | | | | f f | | | | f | | | | | f | | | | | | f | | | | | f f g ƒ q�Wg  } | d k rd g t | ƒ } n„ t | ƒ t | ƒ k rVxi | D] } | j	 | g d ƒ q5WnD t t j | ƒ ƒ } t | ƒ t | ƒ k  rš| d t | ƒ 9} n  |  j | ƒ } |  j | | ƒ } t j | d | d | |	 |
 Ž} |  j | ƒ |  j | | f | | f | | f | ƒ d S(   sr  
        Generate a 3D bar, or multiple bars.

        When generating multiple bars, x, y, z have to be arrays.
        dx, dy, dz can be arrays or scalars.

        *color* can be:

         - A single color value, to color all bars the same color.

         - An array of colors of length N bars, to color each bar
           independently.

         - An array of colors of length 6, to color the faces of the
           bars similarly.

         - An array of colors of length 6 * N bars, to color each face
           independently.

         When coloring the faces of the boxes specifically, this is
         the order of the coloring:

          1. -Z (bottom of box)
          2. +Z (top of box)
          3. -Y
          4. +Y
          5. -X
          6. +X

        Keyword arguments are passed onto
        :func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
        i   s$   x, y, and z must be the same length.g@Œµx¯Dg@Œµx¯Äi   t   zsortt	   facecolorN(   g@Œµx¯Dg@Œµx¯Dg@Œµx¯D(   g@Œµx¯Äg@Œµx¯Äg@Œµx¯Ä(   R·  R   Rì   R­   Rõ   Rö   Rn   RÕ  R   t   extendR   t   listR   R  Rþ  RÛ  Ry  RÚ  Rá  RÇ   (   R@   RE   R_   RM   R{  R|  R€  RÁ  Rf  RC   RD   RÆ   Rp   Rr   Rt   Rq   Rs   Ru   Rå  t   xit   yit   zit   dxit   dyit   dziRÀ  RR  Rù  t   sfacecolorsR’   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   bar3dÉ  sz    "04'$/'$/'$:t   centerc         K   sN   t  j |  | d | d | | �} |  j j ƒ  \ } } |  j j d | ƒ | S(   NR„  t   locgq=
×£pí?(   R   t	   set_titlet   titlet   get_positiont   set_y(   R@   Rˆ  R„  Rs  RD   t   retRE   R_   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyRt  ;	  s    !N(u   t   __name__t
   __module__t   __doc__t   nameR   t   GrouperR'   R   R)   R+   R,   RJ   RN   RR   R6   Rk   Rl   Ry   R~   R�   R„   R‰   R›   Rœ   R�   RŸ   R    R¦   Rµ   R*   R¼   RÇ   R°   Rm   Rï   RG   R   RY   R
  RZ   R  R  Ré   R�  R   Rô   Rê   R  Rë   R  R  R  R  R   t   dedent_interpdR/   R  R  R  R!  R#  R%  R(  R*  R+  R$   R†   R5   RT  RU  RW  R\  RI  RJ  Rg  Rx  RH  R…  R‰  RŠ  R‹  RŒ  RŽ  RY  R¡  R¦  R©  R­  R®  R¯  RÙ   R³  t   text3Dt   text2DRº  t   plot3DRû  Rþ  RÛ  RÏ  R  R&  R:  R?  RA  RC  t	   contour3DRG  RH  t
   contourf3DRI  R.  RY  t	   scatter3DR\  Rq  Rt  (    (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyR   $   sð   N				
					&										B	U	444					
	
						
		/									(	7			
			?&	
	
	
		:	‚				C	u0
	$	&	#!!I2qgš™™™™™©?c   	      C   s¬   d d l  m } t j d d |  ƒ } } t j | | ƒ \ } } | | | d d d d ƒ } | | | d d d	 d	 ƒ } | | } | d
 } | d
 } | d } | | | f S(   s6   
    Return a tuple X, Y, Z with a test data set.
    iÿÿÿÿ(   t   bivariate_normalg      Àg      @g      ð?g        g      ø?g      à?i   i
   iô  (   t   matplotlib.mlabR…  R
   t   aranget   meshgrid(	   Rà   R…  RE   R_   RÃ   RÄ   t   Z1t   Z2RÅ   (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   get_test_dataB	  s    



()   R{  Rõ   t   operatorR    t   matplotlib.axesR–   R�  R   R   t
   matplotlibR   t   matplotlib.transformst
   transformsRÐ   R   t   matplotlib.collectionsRŠ   RK  R   t   matplotlib.scaleR   R   t   matplotlib.tri.triangulationR   t   numpyR
   t   matplotlib.colorsR   R   R	   Ry  Rz   R`   R   R   R‹  t   matplotlib.projectionst   projectionst   projt   projection_registryt   register(    (    (    sU   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.pyt   <module>   s<   	ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ '