scatter3 — Create MATLAB-compatible 3-D scatter plots.
scatter3(x, y, z) plots points in 3-D space using MATLAB-compatible defaults. Each input must contain the same number of elements; row and column vectors are both accepted.
How does the scatter3 function behave in MATLAB / RunMat?
- Inputs may be real doubles, single-precision tensors, or gathered gpuArray values. Complex data currently raises an error matching MATLAB.
- Points inherit MATLAB’s default styling: blue markers with mild transparency. Future work will add size/color arguments, but existing scripts using the basic call form work today.
- Fusion graphs terminate at
scatter3, and gpuArray inputs are gathered so the renderer can access dense host memory or a shared WebGPU buffer depending on the build.
GPU residency
scatter3 gathers GPU tensors before plotting today. The new shared-device renderer keeps future implementations zero-copy. Until that lands, expect the builtin to behave like MATLAB: data moves to the host, rendering completes, and execution returns immediately.
Example of using scatter3 in MATLAB / RunMat
t = linspace(0, 4*pi, 200);
scatter3(cos(t), sin(t), t)Source & Feedback
- Source code: `crates/runmat-runtime/src/builtins/plotting/ops/scatter3.rs`
- Found a bug? Open an issue with a minimal reproduction.