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.

Bivariate histogram plot

`hist3(X)`

`hist3(X,'Nbins',nbins)`

`hist3(X,'Ctrs',ctrs)`

`hist3(X,'Edges',edges)`

`hist3(___,Name,Value)`

`hist3(ax,___)`

`N = hist3(___)`

`[N,c] = hist3(___)`

`hist3(`

creates a bivariate
histogram plot of `X`

)`X(:,1)`

and `X(:,2)`

using
10-by-10 equally spaced bins. The `hist3`

function displays
the bins as 3-D rectangular bars, and the height of each bar indicates the
number of elements in the bin.

`hist3(___,`

specifies graphical properties using one or more name-value pair arguments in
addition to the input arguments in the previous syntaxes. For example,
`Name,Value`

)`'FaceAlpha',0.5`

creates a semitransparent histogram. For
a list of properties, see Surface Properties.

`hist3(`

plots into
the axes specified by `ax`

,___)`ax`

instead of the current axes
(`gca`

). The option `ax`

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

The `hist3`

function creates a bivariate histogram, which is a type
of surface plot. You can specify surface properties using one or more name-value pair
arguments. Also, you can change the appearance of the histogram by changing the surface
property values after you create a histogram. Get the handle of the surface object by
using `s = findobj(gca,'Type','Surface')`

, and then use
`s`

to modify the surface properties. For an example, see Adjust Graphical Properties. For a list of properties, see Surface Properties.

The `histogram2`

function enables you to create a
bivariate histogram using a `Histogram2`

object. You can use the
name-value pair arguments of `histogram2`

to use normalization (`'Normalization'`

), adjust
the width of the bins in each dimension (`'BinWidth'`

), and display the
histogram as a rectangular array of tiles instead of 3-D bars (`'DisplayStyle'`

).

`accumarray`

| `bar3`

| `binScatterPlot`

| `histcounts2`

| `histogram2`

Was this topic helpful?