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

binscatter — Visualize point density with a two-dimensional binned scatter plot.

binscatter(x,y) bins paired observations and displays the bin counts as a colored tile plot. binscatter(x,y,nbins) accepts a scalar or two-element bin count. binscatter(tbl,xvar,yvar) reads numeric variables from a table or timetable. Name-value options support NumBins, XLimits, YLimits, ShowEmptyBins, FaceAlpha, DisplayName, and DisplayStyle set to "tile".

Syntax

binscatter(x, y)
binscatter(x, y, nbins)
binscatter(___, Name, Value)
binscatter(tbl, xvar, yvar)
binscatter(tbl, xvar, yvar, nbins)
binscatter(ax, ___)
All supported binscatter forms
binscatter(x, y)
binscatter(x, y, nbins)
binscatter(___, Name, Value)
binscatter(tbl, xvar, yvar)
binscatter(tbl, xvar, yvar, nbins)
binscatter(ax, ___)
binscatter(ax, x, y, Name, Value)
h = binscatter(___)
h = binscatter(x, y, nbins)

Inputs

NameTypeRequiredDefaultDescription
xNumericArrayYes—X coordinates or table variable selector.
yNumericArrayYes—Y coordinates or table variable selector.
nbinsNumericArrayNo—Scalar or two-element bin count.
nameValuePairsAnyVariadic—Binscatter name-value options.
tblAnyYes—Input table or timetable.
axAxesHandleYes—Target axes handle.

Returns

NameTypeDescription
hNumericScalarHandle to the Binscatter chart.

Errors

IdentifierWhenMessage
RunMat:binscatter:InvalidArgumentInputs, bin controls, or chart options are malformed.binscatter: invalid argument
RunMat:binscatter:InternalRunMat cannot compute bins or render the chart.binscatter: internal error

Examples

Create a binned scatter plot

h = binscatter([0; 0.2; 0.8; 1], [0; 0.1; 0.9; 1], [2 2]);
get(h, 'Values')

Expected output:

ans =
     2     0
     0     2

Use explicit limits and show empty bins

h = binscatter(x, y, 'NumBins', [20 10], 'XLimits', [0 1], 'YLimits', [-1 1], 'ShowEmptyBins', 'on');

Expected output:

h is a binscatter chart handle.

Read numeric variables from a table

T = table(x, y);
h = binscatter(T, 'x', 'y', 25);

Expected output:

h is a binscatter chart handle.

Using binscatter with coding agents

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

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

Related functions

qqplot · scatterhist

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 binned scatter plot
  • Use explicit limits and show empty bins
  • Read numeric variables from a table
  • Using binscatter with coding agents
  • Related functions
  • About RunMat