loglog — Plot data on logarithmic x and y axes for power laws, scaling analysis, and MATLAB loglog comparisons.
loglog builds line objects through the shared RunMat line-plot path and then marks both axes as logarithmic. It is useful for power-law relationships, spectrum-style plots, and any comparison where both dimensions span multiple decades in the MATLAB loglog style.
How loglog works in RunMat
- The returned value is a numeric line handle.
- Both x and y axes are switched to log scale on the active axes.
- Axes scale state remains subplot-local.
- Logarithmic axes are meaningful for positive-domain data on both x and y.
Examples
Plot a power-law curve on logarithmic axes
x = logspace(0, 3, 200);
loglog(x, x.^(-1.5));Compare multiple scaling laws
x = logspace(0, 3, 200);
h1 = loglog(x, x.^(-1));
set(h1, 'DisplayName', 'x^{-1}');
hold on;
h2 = loglog(x, x.^(-2));
set(h2, 'DisplayName', 'x^{-2}');
legend;Inspect both axes after plotting
x = logspace(0, 2, 50);
loglog(x, x.^2);
ax = gca;
xscale = get(ax, 'XScale');
yscale = get(ax, 'YScale');Expected output:
% Both axes report 'log'Related functions to explore
These functions work well alongside loglog. Each page has runnable examples you can try in the browser.
plot, semilogx, semilogy, axis
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how loglog works, line by line, in Rust.
- View loglog.rs on GitHub
- Learn how the runtime works
- Found a bug? Open an issue with a minimal reproduction.
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.