Qu

xscale

Builtin index · Plotting

xscale("log")

Input: "log" · Output: no output

What it is

Sets that axis's scale from a string, "linear" or "log". A log axis draws minor ticks per decade without being asked.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
xscale("log")
"log" stringnot documented yet
no outputA log axis draws minor ticks per decade without being asked.

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
b = butter(4, "low", 100, fs)
h = freqz(b, 512)
f = linspace(0, fs / 2, 512)
plot(f, mag2db(abs(h)), color = "#4169e1", width = 2)
xscale("log")
ylim(-80, 5)
xlabel("frequency (Hz)")
ylabel("magnitude (dB)")
title("4th-order Butterworth, 100 Hz cutoff")
output
· plot: figure 8 (512 points)
-80 -60 -40 -20 0 0 150 300 450 Magnitude Response Frequency (Hz) Magnitude (dB) -150 -100 -50 0 50 100 150 0 150 300 450 Phase Response Frequency (Hz) Phase (deg) -250 -200 -150 -100 -50 0 0 150 300 450 Group Delay Frequency (Hz) Delay (samples) -120 -80 -40 0 40 10−272 10−204 10−136 10−68 100 x=-0.135, y=0.991 x=-0.135, y=-0.991 x=0.57, y=0.821 x=0.57, y=-0.821 4th-order Butterworth, 100 Hz cutoff frequency (Hz) magnitude (dB)

from signal-processing

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

See also

yscale — documented in the same entry.