Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

trisurf

Triangular surface plot

Syntax

trisurf(Tri,X,Y,Z,C)
trisurf(Tri,X,Y,Z)
trisurf(TR)
trisurf(...'PropertyName',PropertyValue...)
h = trisurf(...)

Description

trisurf(Tri,X,Y,Z,C) displays triangles defined in the m-by-3 face matrix Tri as a surface. Each row of Tri defines a single triangular face by indexing into the vectors or matrices that contain the X, Y, and Z vertices. The color is defined by the vector C.

trisurf(Tri,X,Y,Z) uses C=Z so color is proportional to surface height.

trisurf(TR) displays the triangles in a triangulation representation. It uses C = TR.Points(:,3) to make sure the surface color is proportional to height.

trisurf(...'PropertyName',PropertyValue...) specifies additional patch property names and values for the patch graphics object created by the function.

h = trisurf(...) returns a patch handle.

Examples

collapse all

Create vertex vectors and a face matrix, then create a triangular surface plot.

[x,y] = meshgrid(1:15,1:15);
tri = delaunay(x,y);
z = peaks(15);
trisurf(tri,x,y,z)

If the surface is in the form of a triangulation representation, you can pass it to trisurf alone:

tr = triangulation(tri,x(:),y(:),z(:));
trisurf(tr)

Introduced before R2006a

Was this topic helpful?