colormap
colormap(name)
Input: name · Output: no output
What it is
Sets the current panel's categorical/sequential palette to name (string — see the Markers & Styling reference below for the full list). An unknown name silently resolves to "default" rather than erroring.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
colormap(name) | name stringnot 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.
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
colormap("viridis") -- see plotting::PALETTES; an unknown name is accepted and quietly resolves to "default" rather than erroring a whole script over a typo'd palette name.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.