Qu

waterfall

Builtin index · Plotting

waterfall(x, Z)

Input: x, Z · Output: no output

What it is

x is a Vec of numbers (shared horizontal axis); Z is a Mat where each row becomes its own line, each successive row offset up-and-right so traces read back-to-front. A 2-D approximation of the stacked-trace look — no true 3-D projection yet.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
waterfall(x, Z)
x Vec or numberx is a Vec of numbers (shared horizontal axis).
Z MatZ is a Mat where each row becomes its own line, each successive row offset up-and-right so traces read back-to-front.
no outputA 2-D approximation of the stacked-trace look — no true 3-D projection yet.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

x = 0 to 9
y = sin(x / 2)
figure()
stem(x, y)
figure()
stair(x, y)
figure()
groupbar([1, 2, 3], [3, 5, 2])
figure()
stackbar([1, 2, 3], [3, 5, 2])
figure()
Z = [1, 2, 3, 4, 5; 2, 3, 4, 5, 6; 3, 4, 5, 6, 7]
waterfall(0 to 4, Z)
output
· stem: figure 14 (10 points)
· stair: figure 15 (10 points)
· groupbar: figure 16 (3 points)
· stackbar: figure 17 (3 points)
3 4 5 6 7 8 9 10 11 12 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0

from plotting

How it works

waterfall(x, Z) -- one line per row of Z, each successive row offset up-and-right so traces read back-to-front. True 3D approximation of the classic stacked-trace look.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.