
    G8c                     X    d dl Zd dlmZ d dlmZmZ d dlmZ d dl	m
Z
 ddddddddd	Zy)
    N)_api)PolyCollectionTriMesh)	Normalize)Triangulationg      ?flat)alphanormcmapvminvmaxshading
facecolorsc                   t        j                  ddg|       t        j                  |i |	\  }
}}	|E|rt        j                  d       d}t        |      t        |
j                        k7  rt        d      |st        d      t        |      dkD  rt        j                  d	d
|dd d       t        j                  |d         }t        |      t        |
j                        k(  r|}d}n1t        |      t        |
j                        k(  rd}|}nt        d      d}d|	v r|	j                  d      |	d<   |	j                  d|       d}d|	v r|	j                  d      |	d<   |	j                  d|      }d|	v r|	j                  d      |	d<   d|	vr|j                         dk(  rd|	d<   t        j                   t"        df|       |dk(  r|t        d      t%        |
f||||d|	}n|
j'                         }t        j(                  |
j                  |   |
j*                  |   fd      }|||   j-                  d      }n|
j.                  ||
j.                      }n|}t1        |f||||d|	}|j3                  |||       | j5                  d       |
j                  j7                         }|
j                  j9                         }|
j*                  j7                         }|
j*                  j9                         }||f||ff}| j;                  |       | j=                          | j?                  |       |S )a`	  
    Create a pseudocolor plot of an unstructured triangular grid.

    Call signatures::

      tripcolor(triangulation, c, *, ...)
      tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...)

    The triangular grid can be specified either by passing a `.Triangulation`
    object as the first parameter, or by passing the points *x*, *y* and
    optionally the *triangles* and a *mask*. See `.Triangulation` for an
    explanation of these parameters.

    It is possible to pass the triangles positionally, i.e.
    ``tripcolor(x, y, triangles, c, ...)``. However, this is discouraged.
    For more clarity, pass *triangles* via keyword argument.

    If neither of *triangulation* or *triangles* are given, the triangulation
    is calculated on the fly. In this case, it does not make sense to provide
    colors at the triangle faces via *c* or *facecolors* because there are
    multiple possible triangulations for a group of points and you don't know
    which triangles will be constructed.

    Parameters
    ----------
    triangulation : `.Triangulation`
        An already created triangular grid.
    x, y, triangles, mask
        Parameters defining the triangular grid. See `.Triangulation`.
        This is mutually exclusive with specifying *triangulation*.
    c : array-like
        The color values, either for the points or for the triangles. Which one
        is automatically inferred from the length of *c*, i.e. does it match
        the number of points or the number of 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 keyword argument ``facecolors=c`` instead of just
        ``c``.
        This parameter is position-only.
    facecolors : array-like, optional
        Can be used alternatively to *c* to specify colors at the triangle
        faces. This parameter takes precedence over *c*.
    shading : {'flat', 'gouraud'}, default: 'flat'
        If  'flat' and the color values *c* 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.
    other_parameters
        All other parameters are the same as for `~.Axes.pcolor`.
    r   gouraud)r   NzIPositional parameter c has no effect when the keyword facecolors is givenz;The length of facecolors must match the number of triangleszjtripcolor() missing 1 required positional argument: 'c'; or 1 required keyword-only argument: 'facecolors'   z3.6z!Additional positional parameters z\ are ignored; support for them is deprecated since %(since)s and will be removed %(removal)s)messager   zQThe length of c must match either the number of points or the number of triangles)g      ?	linewidth
linewidthsnone	edgecolor
edgecolorsantialiasedantialiasedsF)r
   zashading='gouraud' can only be used when the colors are specified at the points, not at the faces.)r	   arrayr   r
   )axis) r   check_in_listr   get_from_args_and_kwargswarn_externallen	triangles
ValueError	TypeErrorwarn_deprecatednpasarrayxpop
setdefaultlowercheck_isinstancer   r   get_masked_trianglesstackymeanmaskr   _scale_normgridminmaxupdate_datalimautoscale_viewadd_collection)axr	   r
   r   r   r   r   r   argskwargstripoint_colorscr   r   ec
collection
maskedTrisvertscolorsminxmaxxminymaxycornerss                            :/usr/lib/python3/dist-packages/matplotlib/tri/tripcolor.py	tripcolorrJ   	   sm   h 		*G<%>>OOCv
 &' z?c#--00 , - - AB B Y]  !B8, B CD JJtAwq6SZ LJVs3==))LJ D E E
 Jf%zz+6|
lJ/Jf%zz+6|			<	4B!'M!:~V#
f(<!&~9d+$7)!AB B S =\"&T=5;=
 --/
#%%
+SUU:->?bI !*-222:FXX!	*FF#E Df)-DD<BD
 4t,GGEN5599;D5599;D5599;D5599;DTlT4L(Ggj!    )numpyr&   
matplotlibr   matplotlib.collectionsr   r   matplotlib.colorsr   matplotlib.tri.triangulationr   rJ    rK   rI   <module>rR      s,      : ' 6  #DtDQrK   