Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Binned scatter plot

`binscatter(x,y)`

`binscatter(x,y,N)`

`binscatter(___,Name,Value)`

`binscatter(ax,___)`

`h = binscatter(___)`

`binscatter(`

displays a binned scatter plot for vectors `x`

,`y`

)`x`

and
`y`

. A binned scatter plot partitions the data space into
rectangular bins and displays the count of data points in each bin using different
colors. When zooming into the plot, the bin sizes automatically adjust to show finer
resolution.

`binscatter(___,`

specifies property values with one or more name-value pair arguments. For example,
you can specify `Name,Value`

)`'ShowEmptyBins'`

as `'on'`

to
color areas with no data points. For a full list of properties, see Binscatter Properties. Use this option with any of the input argument
combinations in previous syntaxes.

`binscatter(`

plots
into the axes specified by `ax`

,___)`ax`

instead of into the current axes
(`gca`

). The `ax`

input can precede any of
the input argument combinations in previous syntaxes.

Change the

`ColorScale`

property of the axes to`'log'`

to produce better bin coloring when a few bins dominate the plot.ax = gca; ax.ColorScale = 'log';

`histcounts`

| `histcounts2`

| `histogram`

| `histogram2`

| `scatter`