Function File: tricontour (tri, x, y, z, levels)
Function File: tricontour (tri, x, y, z, levels, linespec)
Plot level curves for the values of z on a triangular mesh in 2D.
The variable tri is the triangular meshing of the points
(
x,
y)
which is returned fromdelaunay
. The variable levels is a vector with the values of the countour levels. If levels is a scalar, then it corresponds to the number of level curves to be drawn. If exactly one level curve is desired, list the level twice in the vector levels.If given, linespec determines the properties to use for the lines.
The output argument h is the graphic handle to the plot.
The following code
rand ('state', 2) x = rand (100, 1)-0.5; y = rand (100, 1)-0.5; z= (x.*y); tri = delaunay (x, y); tricontour (tri, x, y, z, [-0.25:0.05:0.25]); axis equal grid on
Produces the following figure
Figure 1 |
---|