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


plots a smooth kernel histogram with estimator specification espec.


plots the distribution function dfun.

Details and Options


open allclose all

Basic Examples  (2)

Plot a smooth density function for a dataset:

Plot the probability density function of the data:

Cumulative distribution function:

Survival function:

Hazard function:

Cumulative hazard function:

Scope  (22)

Data and Wrappers  (8)

Plot different distribution functions:

PlotRange is selected automatically:

Use PlotRange to focus on areas of interest:

Nonreal data points are ignored:

Specify the number of points to use:

Specify the number of times to refine the curve:

Use wrappers on datasets:

Use default tooltips:

Override the default tooltips:

Bandwidth and Kernel  (9)

Specify a single bandwidth for bivariate data:

Specify bivariate bandwidths in units of standard deviation:

Allow bivariate bandwidths to vary adaptively with local density:

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

Vary the initial bandwidth for an adaptive estimate:

Use initial bandwidths of and :

Use any of several automatic bandwidth selection methods:

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

The PDFs are equivalent:

Use different bandwidth specifications in each dimension:

Specify any one of several kernel functions:

Define the kernel function as a pure function:

Presentation  (5)

Add labels:

Color the surface by height:

Create an overlay mesh:

Style the overlay mesh:

Use plot theme:

Options  (37)

BoundaryStyle  (2)

Use a red boundary around the edges of the surface:

BoundaryStyle applies to regions cut by RegionFunction:

ClippingStyle  (4)

Show clipped regions like the rest of the surface:

Leave clipped regions empty:

Use pink to fill the clipped regions:

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

ColorFunction  (5)

Color by scaled coordinate:

Specify gray-level intensity by scaled coordinate:

Named color gradients color in the direction:

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

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

ColorFunctionScaling  (1)

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

Frame  (2)

Draw no frame:

Draw frames on the bottom and the left edges only:

MaxRecursion  (1)

Refine the function where it changes quickly:

Mesh  (7)

SmoothDensityHistogram typically has 10 mesh lines in the direction:

Use 5 mesh lines in the direction:

Use no mesh:

Show the complete sampling mesh:

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

Use mesh lines at specific values:

Use different styles for different mesh lines:

MeshFunctions  (3)

Use the value as the mesh function:

Use mesh lines in the and directions:

Use mesh lines corresponding to fixed distances from the mean:

MeshStyle  (2)

Use red mesh lines:

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

PlotPoints  (1)

Use more initial points to get a smoother density:

PlotRange  (3)

SmoothHistogram3D automatically selects the domain:

Use the full domain generated by SmoothKernelDistribution:

Explicitly provide the domain:

PlotTheme  (2)

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

Change the color scheme:

RegionFunction  (4)

Clip small values of the surface:

BoundaryStyle is used where the region is clipped:

Regions do not have to be connected:

Use any logical combination of conditions:

Applications  (2)

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

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

Properties & Relations  (7)

SmoothDensityHistogram effectively plots the distribution function of SmoothKernelDistribution:

Use DensityHistogram to plot the data in discrete bins:

Use SmoothDensityHistogram and SmoothHistogram3D for bivariate data:

Use SmoothHistogram for univariate data:

Use GeoSmoothHistogram for geographic data:

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

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

Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, (updated 2015).


Wolfram Research (2010), SmoothDensityHistogram, Wolfram Language function, (updated 2015).


Wolfram Language. 2010. "SmoothDensityHistogram." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015.


Wolfram Language. (2010). SmoothDensityHistogram. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_smoothdensityhistogram, author="Wolfram Research", title="{SmoothDensityHistogram}", year="2015", howpublished="\url{}", note=[Accessed: 21-July-2024 ]}


@online{reference.wolfram_2024_smoothdensityhistogram, organization={Wolfram Research}, title={SmoothDensityHistogram}, year={2015}, url={}, note=[Accessed: 21-July-2024 ]}