triplot
Creates a 2D triangulated mesh.
Syntax
h = triplot(tri, x, y)
h = triplot(tri, x, y, fmt)
h = triplot(..., property, value, ...)
h = triplot(hAxes, ...)
Inputs
- tri
- An Mx3 matrix, where M is the number of triangles. Each row contains the indices of a triangle in the x and y matrices. Usually, tri is the output of the delaunay function.
- x, y
- Coordinates of the vertices.
- fmt
- Formatting string for the curve. It can be any combination of the following strings:
- line style: '-', '-.', ':', '--', '-:'.
- line color: 'r', 'g', 'b', 'c', 'y', 'm', 'w', 'k'.
- marker style: 's', 'o', 'd', 'x', 'v', '^', '+', '*', '.'.
- property
- Properties that control the appearance or behavior of the graphics object.
- value
- Value of the properties.
- hAxes
- Axis handle.
Outputs
- h
- Handle of the triplot graphics object.
Examples
Simple triplot example:
N = 20;
x = rand (N, 1);
y = rand (N, 1);
tri = delaunay (x, y);
figure;
h = triplot (tri, x, y);
Set line style in triplot:
N = 20;
x = rand (N, 1);
y = rand (N, 1);
tri = delaunay (x, y);
figure;
h = triplot (tri, x, y, 'r:o');
Comments
If there are no axes, they will be created first.