errorbar — Plot data with symmetric or asymmetric error bars for uncertainty, intervals, and MATLAB errorbar workflows.
errorbar visualizes uncertainty around data points using vertical or both-direction error bars. In RunMat it returns a plot handle, supports MATLAB-style symmetric and asymmetric forms, and participates in the same handle/property and marker-rendering system used by line-like plotting builtins.
How errorbar works in RunMat
- Vertical-only and both-direction error-bar forms are supported through the runtime and replay/render stack.
- The returned value is an error-bar handle that can be queried or updated through
getandset. - Cap size, line styling, marker appearance, display names, and related properties use the shared plotting object/property system.
- Error bars remain subplot-local and integrate naturally with legends and axes state.
- GPU-backed geometry is used when plotting-compatible buffers are available for the full input set; otherwise RunMat falls back to host plotting while preserving the same visible result.
How errorbar runs on the GPU
Dedicated GPU geometry generation covers supported vertical and both-direction error-bar workflows.
Markers continue to use the shared marker path so line/marker styling stays consistent with the rest of the plotting stack.
GPU memory and residency
errorbar preserves GPU residency when the direct error-bar packer path is available for the full input set. Marker rendering stays aligned with the shared marker path.
Examples
Plot symmetric vertical error bars
x = 1:5;
y = [2 3 2.5 4 3.5];
err = [0.2 0.3 0.1 0.4 0.2];
errorbar(x, y, err, err);Plot asymmetric both-direction error bars
x = 1:4;
y = [3 4 2 5];
xn = [0.1 0.2 0.1 0.3];
xp = [0.2 0.3 0.2 0.4];
yn = [0.3 0.2 0.4 0.2];
yp = [0.4 0.3 0.5 0.3];
errorbar(x, y, xn, xp, yn, yp);Style an error-bar object and label it for the legend
x = 1:5;
y = [1 2 1.5 3 2.5];
h = errorbar(x, y, 0.2*ones(size(x)), 0.2*ones(size(x)));
set(h, 'LineWidth', 2, 'DisplayName', 'measurement');
legend;Related functions to explore
These functions work well alongside errorbar. Each page has runnable examples you can try in the browser.
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how errorbar works, line by line, in Rust.
- View errorbar.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.