Waterfall plot
waterfall(
creates a waterfall plot, which is a mesh plot with a partial curtain along the
y dimension. This results in a "waterfall" effect. The
function plots the values in matrix X
,Y
,Z
)Z
as heights above a grid
in the xy-plane defined by
X
and Y
. The edge colors vary
according to the heights specified by Z
.
waterfall(
creates a waterfall
plot, and uses the column and row indices of the elements in
Z
)Z
as the x- and
y-coordinates.
waterfall(
plots
into the axes specified by ax
,___)ax
instead of the current axes.
Specify the axes as the first input argument. This argument can be used with any
of the previous input syntaxes.
p = waterfall(___)
returns the patch object.
Use p
to modify the waterfall plot after it is created. For a
list of properties, see Patch Properties.
To analyze the data as columns instead of rows, call
waterfall
with transposed
arguments:
[X,Y] = meshgrid(-3:.125:3); Z = peaks(X,Y); waterfall(X',Y',Z')
To create a mesh surface object instead of a patch object, use the
meshz
function. To create a plot similar to a waterfall
plot, set the MeshStyle
property of the surface to
'Row'
.
The range of X
, Y
, and Z
, or
the current setting of the axes' XLim
, YLim
, and
ZLim
properties, determines the range of the axes (also set by
axis
). The range of C
, or the current
setting of the axes' CLim
property, determines the color scaling
(also set by caxis
).