title
title(text, [align=])
Input: text, align · Output: no output
What it is
Sets the current panel's title to text (string). align= (string, "left"/"center"/"right", default "center") sets its horizontal alignment.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
title(text, [align=]) | text stringSets the current panel's title to text (string).align string, optionalalign= (string, "left"/"center"/"right", default "center") sets its horizontal alignment. | 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.
Fs = 1000
n = 0:1:1023
t = n / Fs
x = sin(2*pi*80*t) + sin(2*pi*300*t)
spectrogram(x, 128, 32, Fs)
title("Two stationary tones")
xlabel("time (s)")
ylabel("frequency (Hz)")
from numerics-dsp
Fs = 1000
n = 0:1:1023
t = n / Fs
x = sin(2*pi*80*t) + sin(2*pi*300*t)
spectrogram(x, 128, 32, Fs)
title("Two stationary tones")
xlabel("time (s)")
ylabel("frequency (Hz)")
from signal-processing
m = randn(10, 10, seed = 4)
heatmap(m, colormap="viridis")
colorbar
title("Random field")
print("value range: [" + str(min(m)) + ", " + str(max(m)) + "]")
output
value range: [-2.270955, 2.7556]
from plotting
x = 0 to 10 step 0.1
y = sin(x)
plot(x, y)
xlabel("x")
ylabel("sin(x)")
title("First plot")
grid on
savefig("quickstart_plot.svg")
print("saved quickstart_plot.svg")
output
· plot: figure 1 (101 points)
· savefig quickstart_plot.svg
note: this figure uses screen styling and may not hold up in print -- call theme("publication") before saving for a paper (said once per session)
note: fonts render using whatever is installed on the viewer's machine (none are embedded) -- pass embed_fonts=true (fontfamily preset only) or export .tikz for guaranteed appearance
saved quickstart_plot.svgfrom quickstart