xscale
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.
| Code | Input | Output | Description |
xscale("log") | "log" stringnot documented yet | no output | A 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)
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)
from plotting
See also
yscale — documented in the same entry.