scatter
scatter(x, y)
Input: x, y · Output: no output
What it is
Same machinery as plot — x, y are equal-length Vecs of numbers — but defaults its marker to "o" (dots) instead of "line".
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
scatter(x, y) | x Vec or numbernot documented yety Vec or numbernot documented yet | no output | — |
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, 2, 4, 6, 8, 10]
y = [0, 1.8, 1.2, 3.5, 3.0, 4.8]
xq = 0 to 10 step 0.1
plot(xq, interp1(x, y, xq, "linear"))
scatter(x, y)
output
· plot: figure 43 (101 points) · scatter: figure 44 (6 points)
from plotting
x = [0, 2, 4, 6, 8, 10]
y = [0, 1.8, 1.2, 3.5, 3.0, 4.8]
xq = 0 to 10 step 0.1
plot(xq, interp1(x, y, xq, "spline"))
scatter(x, y)
output
· plot: figure 45 (101 points) · scatter: figure 46 (6 points)
from plotting
x = [0, 2, 4, 6, 8, 10]
y = [0, 1.8, 1.2, 3.5, 3.0, 4.8]
xq = 0 to 10 step 0.1
plot(xq, interp1(x, y, xq, "nearest"))
scatter(x, y)
output
· plot: figure 47 (101 points) · scatter: figure 48 (6 points)
from plotting
panel(2, 2, 1)
plot(t, y)
panel(2, 2, 2)
plot(f, mag)
panel(2, 2, 3)
scatter(y, yhat)
panel(2, 2, 4)
plot(losses, color="orange")
output
· plot: figure 53 (6 points) · plot: figure 54 (200 points) · scatter: figure 55 (500 points) · plot: figure 56 (40 points)
from plotting
How it works
stair is the only callable spelling: step is already a reserved keyword (to ... step ... ranges), so step(...) can't be a function call — it lexes as a keyword, not an identifier. The rendered marker is internally still "step".
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.