waterfall
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.
| Code | Input | Output | Description |
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 output | A 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)
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.