ó
±éRc           @  sÄ   d  d l  m Z d  d l m Z m Z m Z m Z d  d l m Z d  d l	 m
 Z
 d e f d „  ƒ  YZ e ƒ  Z e j e
 j e e e e e ƒ d „  Z d d „ Z d	 „  Z d
 „  Z d „  Z d S(   iÿÿÿÿ(   t   print_function(   t
   AitoffAxest
   HammerAxest   LambertAxest   MollweideAxes(   t	   PolarAxes(   t   axest   ProjectionRegistryc           B  s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   sA   
    Manages the set of projections available to the system.
    c         C  s   i  |  _  d  S(   N(   t   _all_projection_types(   t   self(    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   __init__
   s    c         G  s+   x$ | D] } | j  } | |  j | <q Wd S(   s6   
        Register a new set of projection(s).
        N(   t   nameR   (   R	   t   projectionst
   projectionR   (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   register   s    	c         C  s   |  j  | S(   s9   
        Get a projection class from its *name*.
        (   R   (   R	   R   (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   get_projection_class   s    c         C  s   |  j  j ƒ  } | j ƒ  | S(   sZ   
        Get a list of the names of all projections currently
        registered.
        (   R   t   keyst   sort(   R	   t   names(    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   get_projection_names   s    
(   t   __name__t
   __module__t   __doc__R
   R   R   R   (    (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyR      s
   			c         C  s   t  j |  ƒ d  S(   N(   t   projection_registryR   (   t   cls(    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   register_projection.   s    c         C  sN   |  d k r d }  n  y t j |  ƒ SWn! t k
 rI t d |  ƒ ‚ n Xd S(   s€   
    Get a projection class from its name.

    If *projection* is None, a standard rectilinear projection is
    returned.
    t   rectilinears   Unknown projection '%s'N(   t   NoneR   R   t   KeyErrort
   ValueError(   R   (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyR   2   s    	c         K  s   t  |  ƒ | | | � S(   s5  
    Get a new projection instance.

    *projection* is a projection name.

    *figure* is a figure to add the axes to.

    *rect* is a :class:`~matplotlib.transforms.Bbox` object specifying
    the location of the axes within the figure.

    Any other kwargs are passed along to the specific projection
    constructor being used.

    .. deprecated:: 1.3

        This routine is deprecated in favour of getting the projection
        class directly with :func:`get_projection_class` and initialising it
        directly. Will be removed in version 1.3.

    (   R   (   R   t   figuret   rectt   kwargs(    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   projection_factoryB   s    c         O  s  | j  d t ƒ } | j  d d ƒ } | r^ | d k	 rU | d k rU t d | ƒ ‚ n  d } n  | d k r} | j d d ƒ n  t | t ƒ s˜ | d k r§ t | ƒ } nA t | d ƒ rØ | j	 ƒ  \ } } | j
 | �  n t d | ƒ ‚ |  j | | Ž  } | | | f S(	   s  
    Handle the args/kwargs to for add_axes/add_subplot/gca,
    returning::

        (axes_proj_class, proj_class_kwargs, proj_stack_key)

    Which can be used for new axes initialization/identification.

    .. note:: **kwargs** is modified in place.

    t   polarR   sN   polar=True, yet projection=%r. Only one of these arguments should be supplied.t
   resolutioni   t   _as_mpl_axessL   projection must be a string, None or implement a _as_mpl_axes method. Got %rN(   t   popt   FalseR   R   t
   setdefaultt
   isinstancet
   basestringR   t   hasattrR$   t   updatet	   TypeErrort	   _make_key(   R   t   argsR    t   ispolarR   t   projection_classt   extra_kwargst   key(    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   process_projection_requirements[   s&    	
c           C  s
   t  j ƒ  S(   s4   
    Get a list of acceptable projection names.
    (   R   R   (    (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyR   †   s    N(   t
   __future__R    t   geoR   R   R   R   R"   R   t
   matplotlibR   t   objectR   R   R   t   AxesR   R   R   R!   R3   R   (    (    (    sY   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/projections/__init__.pyt   <module>   s"   "				+