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.
SmoothDensityHistogram
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
- SmoothDensityHistogram [data] by default generates colorized grayscale output of the PDF of {{x1,y1},…}, based on a smooth kernel density estimate.
- The estimator specification espec can be of the form bw or {bw,kernel}.
- The specifications for bandwidth bw and kernel are the same as for SmoothKernelDistribution .
- SmoothDensityHistogram [Tabular […]cspec] extracts and plots values from the tabular object using the column specification cspec.
- The following forms of column specifications cspec are allowed for plotting tabular data:
-
{colx,coly} histogram values {x,y} from colx and coly
- Possible distribution functions dfun include:
-
"PDF" probability density function"Intensity" count density function"CDF" cumulative distribution function"SF" survival function"HF" hazard function"CHF" cumulative hazard function
- The form w[data] provides a wrapper w to be applied to the resulting graphics primitives.
- The following wrappers can be used:
-
- SmoothDensityHistogram has the same options as Graphics , with the following additions and changes: [List of all options]
-
- ColorFunction is supplied with a single argument, given by default by the scaled value of f, the PDF , CDF , etc. of the distribution.
- The arguments supplied to RegionFunction are x, y, and f, where f can be the PDF , CDF , etc. of the distribution.
- With the setting MeshShading->Automatic , the colors between mesh lines are computed from the ColorFunction setting.
- With ScalingFunctions->{sx,sy,sz}, the coordinate is scaled using sx, the coordinate is scaled using sy, and the coordinate is scaled using sz.
- Highlight options with settings specific to SmoothDensityHistogram
-
AspectRatio 1 ratio of height to widthImageMargins 0. the margins to leave around the graphicPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic
List of all options
Examples
open all close allBasic 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 (23)
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:
Tabular Data (1)
Create a smooth histogram from pH and alcohol values for different wines:
Increase the bandwidth for a smoother plot:
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 (68)
AspectRatio (4)
By default, SmoothDensityHistogram uses the same width and height:
Use a numerical value to specify the height to width ratio:
AspectRatio Automatic determines the ratio from the plot ranges:
AspectRatio Full adjusts the height and width to tightly fit inside other constructs:
Axes (3)
By default, SmoothDensityHistogram uses a frame instead of axes:
Use axes instead of a frame:
Turn on each axis individually:
AxesLabel (4)
No axes labels are drawn by default:
Place a label on the axis:
Specify axes labels:
Use units as labels:
AxesOrigin (2)
The position of the axes is determined automatically:
Specify an explicit origin for the axes:
AxesStyle (3)
Change the style for the axes:
Specify the style of each axis:
Use different styles for the ticks and the axes:
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:
ImageSize (7)
Use named sizes such as Tiny , Small , Medium and Large :
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatio Full will fill the available space:
Use maximum sizes for the width and height:
Use ImageSize Full to fill the available space in an object:
Specify the image size as a fraction of the available space:
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:
Ticks (4)
TicksStyle (4)
Specify the overall tick style, including the tick labels:
Specify the tick style for each of the axes:
Specify tick marks with scaled lengths:
Customize each tick with position, length, labeling and styling:
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:
Related Guides
History
Introduced in 2010 (8.0) | Updated in 2014 (10.0) ▪ 2015 (10.2) ▪ 2025 (14.2)
Text
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.
APA
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: 17-November-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: 17-November-2025]}