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 scatter3 works in 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 memory and 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
t = linspace(0, 4*pi, 200);
scatter3(cos(t), sin(t), t)Related functions to explore
These functions work well alongside scatter3. Each page has runnable examples you can try in the browser.
bar, contour, contourf, hist, mesh, meshc, plot, scatter, stairs, surf, surfc
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how scatter3 works, line by line, in Rust.
- View scatter3.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.