Qu

ylabel

Builtin index · Plotting

ylabel(text, [align=])

Input: text, align · Output: no output

What it is

Labels the current panel's y-axis with text (string). align= (string, "left"/"center"/"right", plus "bottom"/"top" for the rotated text, default "center") sets alignment. While yyaxis right is active, labels the *right* axis instead of the left one.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
ylabel(text, [align=])
text stringLabels the current panel's y-axis with text (string).
align string, optionalalign= (string, "left"/"center"/"right", plus "bottom"/"top" for the rotated text, default "center") sets alignment.
no outputWhile yyaxis right is active, labels the *right* axis instead of the left one.

Examples

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

scatterfit(t, y, 2)   # degree-2 polynomial fit through the scatter

xlabel("x")
ylabel("y")

from plotting

plot(t, noisy, color = "#b0b0b0")
plot(t, signal, color = "#0072BD")
xlabel("time [s]")
ylabel("amplitude")
savefig("my-first-figure.pdf")
output
· plot: figure 1 (1000 points)
· plot: figure 2 (1000 points)
· savefig my-first-figure.pdf
  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)
-1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 time [s] amplitude

from start-here

plot(v, v .^ 2)
xlabel("x")
ylabel("x^2")
grid on
savefig("squares.pdf")
output
· plot: figure 1 (2 points)
· savefig squares.pdf
  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)
100 150 200 250 300 350 400 10 11 12 13 14 15 16 17 18 19 20 x x^2

from fundamentals

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