RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact
  • License
  • Privacy

Learn

  • Docs
  • Blog
  • Benchmarks
  • RunMat vs MATLAB Online

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • scatterplot

scatterplot — Plot complex-valued samples as 2-D constellation points with MATLAB-compatible scatterplot workflows.

scatterplot visualizes complex samples by plotting real(x) on the x-axis and imag(x) on the y-axis. It supports MATLAB-compatible forms for decimation, offset, marker styling, and selection of an existing scatter figure.

Syntax

h = scatterplot(x)
h = scatterplot(x, n)
h = scatterplot(x, n, offset)
h = scatterplot(x, n, offset, marker)
h = scatterplot(x, n, offset, marker, scatfig)

Inputs

NameTypeRequiredDefaultDescription
xNumericArrayYes—Complex-baseband samples. Real inputs are plotted with zero imaginary part.
xNumericArrayYes—Complex-baseband samples.
nIntegerScalarYes—Positive decimation factor; every n-th sample is plotted.
offsetIntegerScalarYes—Zero-based sample offset before decimation.
nIntegerScalarYes—Positive decimation factor.
markerStyleSpecYes—Marker LineSpec forwarded to scatter.
scatfigNumericScalarYes—Existing figure handle used for the scatter plot.

Returns

NameTypeDescription
hNumericScalarFigure/graphics handle returned by the underlying scatter plot.

Errors

IdentifierWhenMessage
RunMat:scatterplot:InvalidArgumentThe input samples, decimation factor, offset, marker, or existing Figure handle is invalid.scatterplot: invalid argument
RunMat:scatterplot:PlotFailedThe underlying scatter plot cannot be rendered.scatterplot: plot operation failed

How scatterplot works

  • scatterplot(x) plots every complex sample using a constellation-friendly default marker.
  • scatterplot(x, n) plots every n-th sample.
  • scatterplot(x, n, offset) starts at the zero-based offset before applying decimation, matching MATLAB's x(offset+1:n:end) behavior.
  • scatterplot(x, n, offset, marker) forwards the marker LineSpec to scatter.
  • scatterplot(x, n, offset, marker, scatfig) selects an existing Figure handle, matching the Communications Toolbox form; it is not an axes handle.
  • MATLAB documents single/double samples and double integer-valued n/offset. RunMat mode additionally admits real typed-integer samples and typed-integer controls through explicit exact-binary64 checks; strict MATLAB mode rejects those extensions.
  • The generated plot uses equal x/y scaling and grid lines so constellation geometry is not visually distorted.

Does RunMat run scatterplot on the GPU?

The direct path reuses the existing 2-D scatter WGPU renderer and avoids an extra host round-trip for supported GPU inputs.

Decimated sample selection is currently performed on the host to preserve MATLAB-compatible offset semantics.

Marker styling, axes targeting, grid, and equal-axis behavior are consistent between GPU and host fallback rendering.

GPU memory and residency

scatterplot preserves GPU residency for the common scatterplot(x) path when the active provider can materialize real and imaginary buffers on device. Decimation and provider gaps fall back to one host gather, after which the same scatter handle and axes behavior apply.

Examples

Plot a simple QPSK constellation

x = [1+1i; -1+1i; -1-1i; 1-1i];
scatterplot(x);

Plot every fourth received sample with a custom marker

rx = randn(1000, 1) + 1i*randn(1000, 1);
scatterplot(rx, 4, 0, 'gx');

Add samples to an existing scatter figure

h = scatterplot([1+1i; 1-1i]);
scatterplot([-1+1i; -1-1i], 1, 0, 'b.', h);

Using scatterplot with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how scatterplot changes the result.

Run a small scatterplot example, explain the result, then change one input and compare the output.

FAQ

How is scatterplot different from scatter?⌄

scatterplot is specialized for complex symbols. It derives x/y coordinates from the real and imaginary parts of one input vector, applies Communications Toolbox decimation/offset arguments, and configures the axes for constellation viewing. scatter expects explicit x and y coordinate arrays.

Does scatterplot support gpuArray inputs?⌄

Yes. For the no-decimation case, RunMat asks the acceleration provider for real and imaginary GPU buffers and forwards them to the GPU scatter renderer. When decimation is requested or the provider cannot expose those buffers, RunMat gathers the samples once and renders the same visible plot.

Related guides

  • Styling plots and axes
  • GPU plotting and residency

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how scatterplot is executed, line by line, in Rust.

  • View the source for scatterplot in Rust on GitHub
  • Learn how the RunMat 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 blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How scatterplot works
  • Does RunMat run scatterplot on the GPU?
  • GPU memory and residency
  • Examples
  • Plot a simple QPSK constellation
  • Plot every fourth received sample with a custom marker
  • Add samples to an existing scatter figure
  • Using scatterplot with coding agents
  • FAQ
  • Related guides
  • Open-source implementation
  • About RunMat