waterfall

Purpose

Waterfall plot.

Synopsis

waterfall(X,Y,Z,C)
waterfall(X,Y,Z)
waterfall(x,y,Z,C)
waterfall(x,y,Z)
waterfall(Z,C)
waterfall(Z)
h = waterfall(...)

Description

waterfall is similar to the mesh function but it omits the column lines of the plot to produce a "waterfall" effect. For a complete discussion of parametric surfaces and related color properties, see surf.

waterfall(X,Y,Z,C) plots the colored grid lines on the parametric surface specified by X, Y, and Z, with color specified by C. In simpler uses, X and Y may be vectors, and Z and C may be omitted.

The range of X, Y, and Z, or the current setting of axis, determines the axis labels. The range of C, or the current setting of caxis, determines the color scaling. The scaled color values are used as indices into the current color map.

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

waterfall(x,y,Z,C) and waterfall(x,y,Z), with two vector arguments replacing the first two matrix arguments, must have length(x) = n and length(y) = m where [m,n] = size(Z). Here, the intersections of the grid lines are the triples (x(j),y(i),Z(i,j)). Note that x corresponds to the columns of Z and y corresponds to the rows.

waterfall(Z,C) and waterfall(Z) use x = 1:n and y = 1:m.

h = waterfall(...) returns a vector of handles of the patch objects that comprise the plot.

Examples

Produce a waterfall plot of the peaks surface.

[x,y,z] = peaks(30);
waterfall(x,y,z)

See Also

mesh

(c) Copyright 1994 by The MathWorks, Inc.