ó
±éRc           @  s_   d  d l  m Z d  d l m Z m Z d  d l m Z d  d l m Z d  d l	 Z
 d „  Z d S(   iÿÿÿÿ(   t   print_function(   t   PolyCollectiont   TriMesh(   t	   Normalize(   t   TriangulationNc         O  sƒ  |  j  s |  j ƒ  n  | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d d ƒ } | j d	 d ƒ }	 t j | | Ž  \ }
 } } |	 d k	 rÄ |	 } n t j | d
 ƒ } |	 d k r.t | ƒ t |
 j	 ƒ k r.t | ƒ t |
 j
 ƒ k r.| d k r.| }	 n  |	 d k rUt | ƒ t |
 j
 ƒ k s||	 d k	 r‹t | ƒ t |
 j	 ƒ k r‹t d ƒ ‚ n  d } d | k r³| j d ƒ | d <n  | j d | ƒ | d k rØd } n d } d | k r | j d ƒ | d <n  | j d | ƒ } d | k r4| j d ƒ | d <n  d | k r_| j ƒ  d k r_t | d <n  | d k rÂ|	 d k	 r†t d ƒ ‚ n  t | ƒ t |
 j
 ƒ k r°t d ƒ ‚ n  t |
 | � } n« |
 j ƒ  } t j |
 j
 | d t j f |
 j | d t j f f d d ƒ} |	 d k r6| | j d d ƒ } n( |
 j d k	 r^| j d |
 j ƒ } n  t | | � } | j | ƒ | j | ƒ | d k	 r«t | t ƒ s«t ‚ n  | j | ƒ | j | ƒ | d k	 sÝ| d k	 rð| j | | ƒ n
 | j  ƒ  |  j! t ƒ |
 j
 j" ƒ  } |
 j
 j# ƒ  } |
 j j" ƒ  } |
 j j# ƒ  } | | f | | f f } |  j$ | ƒ |  j% ƒ  |  j& | ƒ | S(   sh  
    Create a pseudocolor plot of an unstructured triangular grid.

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

      tripcolor(triangulation, ...)

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

    ::

      tripcolor(x, y, ...)
      tripcolor(x, y, triangles, ...)
      tripcolor(x, y, triangles=triangles, ...)
      tripcolor(x, y, mask=mask, ...)
      tripcolor(x, y, triangles, mask=mask, ...)

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

    The next argument must be *C*, the array of color values, either
    one per point in the triangulation if color values are defined at
    points, or one per triangle in the triangulation if color values
    are defined at triangles. If there are the same number of points
    and triangles in the triangulation it is assumed that color
    values are defined at points; to force the use of color values at
    triangles use the kwarg *facecolors*=C instead of just *C*.

    *shading* may be 'flat' (the default) or 'gouraud'. If *shading*
    is 'flat' and C values are defined at points, the color values
    used for each triangle are from the mean C of the triangle's
    three points. If *shading* is 'gouraud' then color values must be
    defined at points.  *shading* of 'faceted' is deprecated;
    please use *edgecolors* instead.

    The remaining kwargs are the same as for
    :meth:`~matplotlib.axes.Axes.pcolor`.

    **Example:**

        .. plot:: mpl_examples/pylab_examples/tripcolor_demo.py
    t   alphag      ð?t   normt   cmapt   vmint   vmaxt   shadingt   flatt
   facecolorsi    t   gouraudsg   Length of color values array must be the same as either the number of triangulation points or trianglesg      Ð?t	   linewidtht
   linewidthst   facetedt   kt   nonet	   edgecolort
   edgecolorst   antialiasedt   antialiasedss<   Gouraud shading does not support the use of facecolors kwargsl   For gouraud shading, the length of color values array must be the same as the number of triangulation points.t   axisi   i   N(   g      Ð?('   t   _holdt   clat   popt   NoneR   t   get_from_args_and_kwargst   npt   asarrayt   lent	   trianglest   xt
   ValueErrort
   setdefaultt   lowert   FalseR   t   get_masked_trianglest   concatenatet   newaxist   yt   meant   maskt   compressR   t	   set_alphat	   set_arrayt
   isinstanceR   t   AssertionErrort   set_cmapt   set_normt   set_climt   autoscale_Nonet   gridt   mint   maxt   update_datalimt   autoscale_viewt   add_collection(   t   axt   argst   kwargsR   R   R   R   R	   R
   R   t   trit   CR   R   t   ect
   collectiont
   maskedTrist   vertst   minxt   maxxt   minyt   maxyt   corners(    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/tri/tripcolor.pyt	   tripcolor   s„    -	 	''	''	& 

(   t
   __future__R    t   matplotlib.collectionsR   R   t   matplotlib.colorsR   t   matplotlib.tri.triangulationR   t   numpyR   RI   (    (    (    sR   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/matplotlib/tri/tripcolor.pyt   <module>   s
   