subplot
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.
| Code | Input | Output | Description |
panel(rows, cols, k) | rows —not documented yetcols —not documented yetk —not documented yet | no output | subplot 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.
figure()
t = linspace(0, 1, 200)
plot(t, sin(2 * pi * 5 * t))
xticks([0, 0.5, 1])
xticklabels("start", "mid", "end")
yticks([-1, 0, 1])
yticklabels("low", "zero", "high")
fontfamily("sans")
fontsize(tick = 10, label = 12, title = 14)
figure_background("#f7f7f7")
colormap("viridis")
colorbar()
grid()
box()
subplot(1, 1, 1)
xscale("linear")
yscale("linear")
title("Styled panel")
output
· plot: figure 8 (200 points)
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
panel — documented in the same entry.