WOLFRAM

SmoothDensityHistogram[{{x1,y1},{x2,y2},}]

plots a smooth kernel histogram of the values {xi,yi}.

SmoothDensityHistogram[{{x1,y1},{x2,y2},},espec]

plots a smooth kernel histogram with estimator specification espec.

SmoothDensityHistogram[{{x1,y1},{x2,y2},},espec,dfun]

plots the distribution function dfun.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Plot a smooth density function for a dataset:

Out[1]=1

Plot the probability density function of the data:

Out[2]=2

Cumulative distribution function:

Out[3]=3

Survival function:

Out[4]=4

Hazard function:

Out[5]=5

Cumulative hazard function:

Out[6]=6

Scope  (23)Survey of the scope of standard use cases

Data and Wrappers  (8)

Plot different distribution functions:

Out[1]=1

PlotRange is selected automatically:

Out[2]=2

Use PlotRange to focus on areas of interest:

Out[3]=3

Nonreal data points are ignored:

Out[2]=2

Specify the number of points to use:

Out[1]=1

Specify the number of times to refine the curve:

Out[1]=1

Use wrappers on datasets:

Out[2]=2

Use default tooltips:

Out[2]=2

Override the default tooltips:

Out[2]=2

Tabular Data  (1)

Out[1]=1

Bandwidth and Kernel  (9)

Specify a single bandwidth for bivariate data:

Out[2]=2

Specify bivariate bandwidths in units of standard deviation:

Out[2]=2

Allow bivariate bandwidths to vary adaptively with local density:

Use the local sensitivity from (small) to (large):

Out[2]=2

Vary the initial bandwidth for an adaptive estimate:

Use initial bandwidths of and :

Out[2]=2

Use any of several automatic bandwidth selection methods:

Out[2]=2

Silverman's method is used by default for bandwidth selection:

The PDFs are equivalent:

Out[2]=2

Use different bandwidth specifications in each dimension:

Out[2]=2

Specify any one of several kernel functions:

Out[2]=2

Define the kernel function as a pure function:

Out[2]=2

Presentation  (5)

Add labels:

Out[1]=1

Color the surface by height:

Out[1]=1

Create an overlay mesh:

Out[1]=1

Style the overlay mesh:

Out[1]=1

Use plot theme:

Out[1]=1

Options  (37)Common values & functionality for each option

BoundaryStyle  (2)

Use a red boundary around the edges of the surface:

Out[1]=1

BoundaryStyle applies to regions cut by RegionFunction:

Out[1]=1

ClippingStyle  (4)

Show clipped regions like the rest of the surface:

Out[1]=1

Leave clipped regions empty:

Out[1]=1

Use pink to fill the clipped regions:

Out[1]=1

Use blue where the surface is clipped above and red below:

Out[1]=1

ColorFunction  (5)

Color by scaled coordinate:

Out[1]=1

Specify gray-level intensity by scaled coordinate:

Out[1]=1

Named color gradients color in the direction:

Out[1]=1

Use brightness to correspond to the height or density of a function:

Out[1]=1

Use the interpolation between two colors to indicate the height or density of a function:

Out[1]=1

ColorFunctionScaling  (1)

Color using the natural range of values by setting ColorFunctionScaling to False:

Out[1]=1

Frame  (2)

Draw no frame:

Out[1]=1

Draw frames on the bottom and the left edges only:

Out[1]=1

MaxRecursion  (1)

Refine the function where it changes quickly:

Out[1]=1

Mesh  (7)

SmoothDensityHistogram typically has 10 mesh lines in the direction:

Out[1]=1

Use 5 mesh lines in the direction:

Out[1]=1

Use no mesh:

Out[1]=1

Show the complete sampling mesh:

Out[1]=1

Use 3 mesh lines in the direction and 6 mesh lines in the direction:

Out[1]=1

Use mesh lines at specific values:

Out[1]=1

Use different styles for different mesh lines:

Out[1]=1

MeshFunctions  (3)

Use the value as the mesh function:

Out[1]=1

Use mesh lines in the and directions:

Out[1]=1

Use mesh lines corresponding to fixed distances from the mean:

Out[2]=2

MeshStyle  (2)

Use red mesh lines:

Out[1]=1

Use red mesh lines in the direction and dashed mesh lines in the direction:

Out[1]=1

PlotPoints  (1)

Use more initial points to get a smoother density:

Out[1]=1

PlotRange  (3)

SmoothHistogram3D automatically selects the domain:

Out[2]=2

Use the full domain generated by SmoothKernelDistribution:

Out[2]=2

Explicitly provide the domain:

Out[2]=2

PlotTheme  (2)

Use a theme with simple ticks and grid lines in a bright color scheme:

Out[1]=1

Change the color scheme:

Out[1]=1

RegionFunction  (4)

Clip small values of the surface:

Out[1]=1

BoundaryStyle is used where the region is clipped:

Out[1]=1

Regions do not have to be connected:

Out[1]=1

Use any logical combination of conditions:

Out[1]=1

Applications  (2)Sample problems that can be solved with this function

Show the distribution of eruptions of the Old Faithful geyser at Yellowstone National Park:

Out[1]=1

Smooth density histogram for a multivariate time slice of a random process:

Out[2]=2

Properties & Relations  (7)Properties of the function, and connections to other functions

SmoothDensityHistogram effectively plots the distribution function of SmoothKernelDistribution:

Out[2]=2

Use DensityHistogram to plot the data in discrete bins:

Out[2]=2

Use SmoothDensityHistogram and SmoothHistogram3D for bivariate data:

Out[2]=2

Use SmoothHistogram for univariate data:

Out[2]=2

Use GeoSmoothHistogram for geographic data:

Out[1]=1

Additional points will result in a better approximation of the underlying distribution:

Out[2]=2

As the bandwidth approaches infinity, the estimate approaches the shape of the kernel:

Out[3]=3
Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html (updated 2025).
Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html (updated 2025).

Text

Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html (updated 2025).

Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html (updated 2025).

CMS

Wolfram Language. 2010. "SmoothDensityHistogram." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html.

Wolfram Language. 2010. "SmoothDensityHistogram." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html.

APA

Wolfram Language. (2010). SmoothDensityHistogram. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html

Wolfram Language. (2010). SmoothDensityHistogram. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html

BibTeX

@misc{reference.wolfram_2025_smoothdensityhistogram, author="Wolfram Research", title="{SmoothDensityHistogram}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html}", note=[Accessed: 28-March-2025 ]}

@misc{reference.wolfram_2025_smoothdensityhistogram, author="Wolfram Research", title="{SmoothDensityHistogram}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html}", note=[Accessed: 28-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_smoothdensityhistogram, organization={Wolfram Research}, title={SmoothDensityHistogram}, year={2025}, url={https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html}, note=[Accessed: 28-March-2025 ]}

@online{reference.wolfram_2025_smoothdensityhistogram, organization={Wolfram Research}, title={SmoothDensityHistogram}, year={2025}, url={https://reference.wolfram.com/language/ref/SmoothDensityHistogram.html}, note=[Accessed: 28-March-2025 ]}