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

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

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.

LicensePrivacy
/
See all docs
Builtin Reference
    • binscatter
    • close
    • qqplot
    • scatterhist

scatterhist — Create a scatter plot with marginal histograms.

scatterhist(x,y) creates a scatter plot with marginal distributions for vector inputs x and y. scatterhist(x,y,Name,Value) supports common MATLAB-compatible controls including NBins, Group, PlotGroup, Kernel, Style, Bandwidth, Legend, Location, Direction, Color, Marker, MarkerSize, LineStyle, LineWidth, and Parent. The return value is a three-element axes-handle vector for the scatter axes, x marginal axes, and y marginal axes.

Syntax

scatterhist(x, y)
scatterhist(x, y, Name, Value)
h = scatterhist(___)

Inputs

NameTypeRequiredDefaultDescription
xNumericArrayYes—X observations.
yNumericArrayYes—Y observations.
nameValuePairsAnyVariadic—Scatterhist name-value options.

Returns

NameTypeDescription
hNumericArrayThree axes handles: scatter, x marginal, and y marginal.

Errors

IdentifierWhenMessage
RunMat:scatterhist:InvalidArgumentObservation vectors or name-value options are malformed.scatterhist: invalid argument
RunMat:scatterhist:InternalRunMat cannot allocate or render the scatterhist chart.scatterhist: internal error

Examples

Create a scatter plot with marginal histograms

h = scatterhist([0; 0.2; 0.8; 1], [0; 0.1; 0.9; 1], 'NBins', [2 2])

Expected output:

h is a 3-by-1 vector of axes handles.

Group observations and show kernel marginals

g = ["a"; "b"; "a"; "b"];
h = scatterhist(x, y, 'Group', g, 'Kernel', 'overlay', 'Legend', 'on');

Expected output:

RunMat renders grouped scatter series with marginal density lines.

Using scatterhist with coding agents

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

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

Related functions

binscatter · qqplot

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
  • Examples
  • Create a scatter plot with marginal histograms
  • Group observations and show kernel marginals
  • Using scatterhist with coding agents
  • Related functions
  • About RunMat