stairs — Render MATLAB-compatible stairs (step) plots.
stairs(x, y) draws a stairstep graph of the data in y versus the points in x, matching MATLAB's default styling. Each successive pair of points generates a horizontal segment followed by a vertical jump.
How does the stairs function behave in MATLAB / RunMat?
- Inputs must be real vectors of matching, non-zero length.
- With
singleprecision gpuArrays and the shared WebGPU renderer active, RunMat packs the vertex buffer directly on the GPU. Other data falls back to the CPU path automatically. - Like MATLAB, repeated calls append to the current axes when
hold onis enabled.
Example of using stairs in MATLAB / RunMat
t = 0:5;
stairs(t, cumsum(rand(size(t))))Source & Feedback
- Source code: `crates/runmat-runtime/src/builtins/plotting/ops/stairs.rs`
- Found a bug? Open an issue with a minimal reproduction.