Qu

panel

Builtin index · Plotting

panel(rows, cols, k)

Input: rows, cols, k · Output: no output

What it is

Selects cell k (integer, 1-based, row-major) of a rows-by-cols (integers) grid as the target for further drawing. subplot is the same call under MATLAB's name.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
panel(rows, cols, k)
rows —not documented yet
cols —not documented yet
k —not documented yet
no outputsubplot is the same call under MATLAB's name.

Examples

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

panel(2, 1, 1)
bode_magnitude(Z, freqs)
panel(2, 1, 2)
bode_phase(Z, freqs)
28 30 32 34 36 38 40 0.1 1.0 10.0 100.0 1000.0 -50 -40 -30 -20 -10 0.1 1.0 10.0 100.0 1000.0

from specialized

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)
0 1 2 3 4 5 0 0.3 0.6 0.9 0.1 0.3 0.5 0.7 0.9 0 300 600 900 -0.8 -0.4 0 0.4 0.8 0 2 3 4 x=0, y=0 x=1.8, y=0.063 x=1.2, y=0.126 x=3.5, y=0.188 x=3, y=0.249 x=4.8, y=0.31 0 0.2 0.4 0.6 0.8 1.0 0 10 20 30 40

from plotting

group_a = randn(40, seed = 11)
group_b = randn(40, seed = 12) + 0.5
group_c = randn(40, seed = 13) - 0.3
panel(1, 2, 1)
histogram(y, 20)
panel(1, 2, 2)
boxplot(group_a, group_b, group_c)
output
· histogram: figure 57 (6 points, 20 bins)
0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 0 2 3 4 x=0.12, y=1 x=0.36, y=0 x=0.6, y=0 x=0.84, y=0 x=1.08, y=0 x=1.32, y=1 x=1.56, y=0 x=1.8, y=1 x=2.04, y=0 x=2.28, y=0 x=2.52, y=0 x=2.76, y=0 x=3, y=1 x=3.24, y=0 x=3.48, y=1 x=3.72, y=0 x=3.96, y=0 x=4.2, y=0 x=4.44, y=0 x=4.68, y=1 -2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 2.5 3.0 0 300 600 900 -1.0 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1.0 0 2 3 4 x=0, y=0 x=1.8, y=0.063 x=1.2, y=0.126 x=3.5, y=0.188 x=3, y=0.249 x=4.8, y=0.31 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0 10 20 30 40

from plotting

How it works

panel(rows, cols, index) -- MATLAB-style subplot, kept under both spellings (§13.C: "panel" is the current name; subplot remains a plain alias, same pattern as the def fn/:= alias).

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

See also

subplot — documented in the same entry.