Qu

theme

Builtin index · Plotting

theme(name)

Input: name · Output: no output

What it is

Sets the whole-figure visual theme from name (string): one of "default", "publication", "bw", "minimal", "grey", "classic". "publication" also embeds fonts, because a figure asked to be print-ready has to look the same wherever it lands.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
theme(name)
name stringnot documented yet
no output"publication" also embeds fonts, because a figure asked to be print-ready has to look the same wherever it lands.

Examples

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

theme("publication")
figure_size(3.5, 2.4, unit = "in")

plot(t[0:400], y[0:400], color = "#b0b0b0", lw = pt(0.6), label = "measured")
plot(t[0:400], smoothed[0:400], color = "#0072BD", lw = pt(1.2), label = "filtered")
xlabel("time $t$ [s]")
ylabel("amplitude")
title("A 50 Hz tone, low-pass filtered")
legend()
savefig("first-figure.pdf")
output
· plot: figure 1 (401 points)
· plot: figure 2 (401 points)
· savefig first-figure.pdf
-1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 0 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 A 50 Hz tone, low-pass filtered time t [s] amplitude measured filtered

from from-zero

How it works

theme("minimal") / theme("default") — see plotting::Figure.minimal. Figure-level, like fontfamily/ fontsize/figure_background, not per-panel. Any name other than "minimal" (including a typo) resolves to the default journal-style theme rather than erroring, matching colormap's own "bad name is not fatal" convention. theme("minimal") / theme("publication") / theme("screen"). "publication" is a TARGET, not just a look (see plotting::Figure.publication): the figure is bound for a printed page rather than this monitor. Because that target implies a whole set of choices that would be tedious and easy to get wrong one call at a time, it also sets the two companions a print figure almost always wants -- Latin Modern (the typeface a LaTeX paper is already set in) and the colourblind-safe Okabe-Ito palette. Both remain overridable: call fontfamily(...)/colormap(...) AFTER theme(...) and your choice wins, exactly like fontsize after figure_size.

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