RunMat
GitHub

semilogx — Plot data with a logarithmic x-axis for response curves, scaling analysis, and MATLAB semilogx workflows.

semilogx creates the same line objects as plot, but configures the current axes to use a logarithmic x-axis. That makes it useful for response curves, magnitude plots, and data that spans orders of magnitude along X while still using familiar MATLAB semilogx call forms.

How semilogx works in RunMat

  • The builtin returns the same kind of numeric line handle as plot.
  • Only the x-axis is switched to log scale; the y-axis remains linear.
  • Axes log-mode state is subplot-local, so semilogx on one subplot does not force every axes in the figure into log mode.
  • Positive x-values are the meaningful domain for a logarithmic axis, even though the plotted line object still preserves the original data handle semantics.

Examples

Plot a frequency response with a logarithmic x-axis

f = logspace(0, 4, 200);
mag = 1 ./ sqrt(1 + (f / 200).^2);
semilogx(f, mag);

Compare two responses on the same semilog x-axis

f = logspace(0, 4, 200);
h1 = semilogx(f, 1 ./ sqrt(1 + (f / 200).^2));
set(h1, 'DisplayName', 'low-pass');
hold on;
h2 = semilogx(f, (f / 200) ./ sqrt(1 + (f / 200).^2));
set(h2, 'DisplayName', 'high-pass');
legend;

Verify the x-axis scale through handle/property workflows

f = logspace(1, 3, 50);
semilogx(f, log10(f));
ax = gca;
get(ax, 'XScale')

Expected output:

ans =
    'log'

These functions work well alongside semilogx. Each page has runnable examples you can try in the browser.

plot, semilogy, loglog, axis

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how semilogx works, line by line, in Rust.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.

  • Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
  • Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
  • A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.

Getting started · Benchmarks · Pricing

Try RunMat — free, no sign-up

Start running MATLAB code immediately in your browser.