U
    Fvf                     @   s8   d dl Zd dlmZ d dlmZ d dlmZ dd Z	dS )    N)Triangulationc                 O   sf  ddl }tj||\}}}|j|j|j  }}}|r<|d nd}|jj|\}	}
}t	
|tj}td|	|
|fD ]\}}|dk	rr||| qr|d }	|d|ddd	}|	d
krtj|| dtjdd}tj|| dtjdd}| j| | f|}n| jg g f|}|d }
|ddi}|dd |
d
krN| j||f|}n| jg g f|}|| S )a  
    Draw an unstructured triangular grid as lines and/or markers.

    Call signatures::

      triplot(triangulation, ...)
      triplot(x, y, [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*. If neither of *triangulation* or
    *triangles* are given, the triangulation is calculated on the fly.

    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*.
    other_parameters
        All other args and kwargs are forwarded to `~.Axes.plot`.

    Returns
    -------
    lines : `~matplotlib.lines.Line2D`
        The drawn triangles edges.
    markers : `~matplotlib.lines.Line2D`
        The drawn marker nodes.
    r   N )	linestylemarkercolorr   Nonezorder   )r   r   )Nr   r       )Zaxisr   label)Zmatplotlib.axesr   Zget_from_args_and_kwargsxyedgesZaxes_baseZ_process_plot_formatcbookZnormalize_kwargsmlinesZLine2Dzip
setdefaultgetnpinsertnanZplotZravelpop)ZaxargskwargsZ
matplotlibZtrir   r   r   fmtr   r   r   kwkeyvalZkw_linesZtri_lines_xZtri_lines_yZ	tri_linesZ
kw_markersZtri_markers r    ;/tmp/pip-unpacked-wheel-7vhvci0g/matplotlib/tri/_triplot.pytriplot   sB    

 
r"   )
Znumpyr   Zmatplotlib.tri._triangulationr   Zmatplotlib.cbookr   Zmatplotlib.lineslinesr   r"   r    r    r    r!   <module>   s   