triplot

Plots a 2-D triangulation as line edges.

Category: Mathematics > Computational Geometry

Syntax

triplot(T, x, y)

Draws the edges of the triangles T with vertex coordinates x and y.

triplot(TR)

Draws a triangulation or delaunayTriangulation object.

h = triplot(___)

Also returns the line handle.

Description

triplot is the standard way to see a 2-D mesh. All triangle edges are drawn as one line object, so large meshes stay cheap to render. It is commonly paired with delaunay to visualize the triangulation of a point set, and combined with hold on and plot to overlay the points.

Input arguments

T
m-by-3 matrix of vertex indices, one triangle per row.
x, y
Column vectors with the coordinates of the vertices.

Output arguments

h
Handle to a line object holding all edges.

Example

Delaunay triangulation of five points

x = [0 1 0 1 0.5];
y = [0 0 1 1 0.5];
T = delaunay(x, y);
triplot(T, x, y);

See also

delaunay trimesh trisurf voronoi