Qu

yticks

Builtin index · Plotting

yticks([0, 1, 2])

Input: 0, 1, 2 · Output: no output

What it is

yticks takes a Vec of numbers (tick positions, data units); yticklabels takes variadic strings to relabel them in order. yticks(()) (empty) removes ticks entirely; axis off removes the whole frame instead.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
yticks([0, 1, 2])
0, 1, 2 Vec, number, or string, optionalnot documented yet
no outputyticks takes a Vec of numbers (tick positions, data units); yticklabels takes variadic strings to relabel them in order. yticks(()) (empty) removes ticks entirely; axis off removes the whole frame instead.

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)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Styled panel

from plotting

How it works

yticks(positions) / yticklabels(...) -- the y-axis pair the x axis has always had. Both honour yyaxis left/right, so a secondary axis can carry its own scale: the decision nomogram's right axis reads tone count off a CF ratio through a non-linear map, which is not expressible as a second series.

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

See also

yticklabels — documented in the same entry.