SmoothDensityHistogram
✖
SmoothDensityHistogram
plots a smooth kernel histogram of the values {xi,yi}.
plots a smooth kernel histogram with estimator specification espec.
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:
-
Annotation[e,label] provide an annotation Button[e,action] define an action to execute when the element is clicked EventHandler[e,…] define a general event handler for the element Hyperlink[e,uri] make the element act as a hyperlink PopupWindow[e,cont] attach a popup window to the element StatusArea[e,label] display in the status area when the element is moused over Style[e,opts] show the element using the specified styles Tooltip[e,label] attach an arbitrary tooltip to the element - SmoothDensityHistogram has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1 ratio of height to width BoundaryStyle None how to draw RegionFunction boundaries BoxRatios Automatic effective 3D bounding box ratios ClippingStyle None how to draw values clipped by PlotRange ColorFunction Automatic how to color the plot ColorFunctionScaling True whether to scale the argument to ColorFunction Frame True whether to draw a frame around the plot FrameTicks Automatic frame tick marks LightingAngle None effective angle of the simulated light source MaxRecursion Automatic the maximum number of recursive subdivisions allowed Mesh None how many mesh lines to draw MeshFunctions {#3&} how to determine the placement of mesh lines MeshShading Automatic how to shade regions between mesh lines MeshStyle Automatic the style for mesh lines Method Automatic the method to use for refining the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotPoints Automatic the initial number of sample points for the function in each direction PlotRange Automatic the range of f or other values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotTheme $PlotTheme overall theme for the plot RegionFunction (True&) how to determine whether a point should be included ScalingFunctions None how to scale individual coordinates WorkingPrecision MachinePrecision the precision used in internal computations - 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.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1 ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic BoundaryStyle None how to draw RegionFunction boundaries BoxRatios Automatic effective 3D bounding box ratios ClippingStyle None how to draw values clipped by PlotRange ColorFunction Automatic how to color the plot ColorFunctionScaling True whether to scale the argument to ColorFunction ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame True whether to draw a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame tick marks FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels LightingAngle None effective angle of the simulated light source MaxRecursion Automatic the maximum number of recursive subdivisions allowed Mesh None how many mesh lines to draw MeshFunctions {#3&} how to determine the placement of mesh lines MeshShading Automatic how to shade regions between mesh lines MeshStyle Automatic the style for mesh lines Method Automatic the method to use for refining the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotPoints Automatic the initial number of sample points for the function in each direction PlotRange Automatic the range of f or other values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RegionFunction (True&) how to determine whether a point should be included RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale individual coordinates Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks WorkingPrecision MachinePrecision the precision used in internal computations
List of all options




Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Plot a smooth density function for a dataset:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-umuo8a

Plot the probability density function of the data:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-usgcjb

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-ynj6e

Cumulative distribution function:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-ms1psj


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-mrrcwo


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-t3qrax


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-xidk3c

Scope (23)Survey of the scope of standard use cases
Data and Wrappers (8)
Plot different distribution functions:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-fd1f9l

PlotRange is selected automatically:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-dl3n9y

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-rawkfx

Use PlotRange to focus on areas of interest:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-pkua49

Nonreal data points are ignored:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-lqjnxh

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-s0irj4

Specify the number of points to use:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-l1dbei

Specify the number of times to refine the curve:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-2yalfn


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-xen594

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-zrp2jf


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-uefuct

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-h7ab9q

Override the default tooltips:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-k43m8e

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-qfodye

Tabular Data (1)

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-cb9s1x

Bandwidth and Kernel (9)
Specify a single bandwidth for bivariate data:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-6i4hn

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-idv22h

Specify bivariate bandwidths in units of standard deviation:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-gth93u

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-d4vsn5

Allow bivariate bandwidths to vary adaptively with local density:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-bnkjfo
Use the local sensitivity from (small) to
(large):

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-f2hl7i

Vary the initial bandwidth for an adaptive estimate:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-gukfm5
Use initial bandwidths of and
:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-fatg8a

Use any of several automatic bandwidth selection methods:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-i3icnm

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-igqicu

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-jzjv4g

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-oijjnl

Use different bandwidth specifications in each dimension:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-fb6r0c

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-6zzze

Specify any one of several kernel functions:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-iuq9xu

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-nn4ei5

Define the kernel function as a pure function:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-i8w57

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-hhjpj5

Presentation (5)

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-jsuhnx


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-wt7htg


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-mysnz7


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-hf0sv5


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-73g10l

Options (37)Common values & functionality for each option
BoundaryStyle (2)
Use a red boundary around the edges of the surface:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-dtdvpy

BoundaryStyle applies to regions cut by RegionFunction:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-k3fpur

ClippingStyle (4)
Show clipped regions like the rest of the surface:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-hcatpe


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-v2pdy4

Use pink to fill the clipped regions:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-y2v5ev

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-mz7dlf

ColorFunction (5)

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-b88teb

Specify gray-level intensity by scaled coordinate:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-e7eow7

Named color gradients color in the direction:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-bgfl0u

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-dt8jri

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-nv909j

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-esjakt

Frame (2)
MaxRecursion (1)
Mesh (7)
SmoothDensityHistogram typically has 10 mesh lines in the direction:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-uvpncn

Use 5 mesh lines in the direction:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-hzylc5


https://wolfram.com/xid/0bzpv1cy9r1fv37u6-em2swl

Show the complete sampling mesh:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-c3ajw0

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-2as1z2

Use mesh lines at specific values:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-1pybtb

Use different styles for different mesh lines:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-gu3zw0

MeshFunctions (3)
Use the value as the mesh function:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-mvz

Use mesh lines in the and
directions:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-nka9n

Use mesh lines corresponding to fixed distances from the mean:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-wokp1o

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-8mjlmk

MeshStyle (2)
PlotPoints (1)
PlotRange (3)
SmoothHistogram3D automatically selects the domain:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-2jlc1b

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-9g3z7d

Use the full domain generated by SmoothKernelDistribution:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-7fl668

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-v4jpxe

Explicitly provide the domain:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-8d9yd0

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-nnhkfq

PlotTheme (2)
RegionFunction (4)
Clip small values of the surface:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-51du1j

BoundaryStyle is used where the region is clipped:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-1iqn0o

Regions do not have to be connected:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-sxlahb

Use any logical combination of conditions:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-zj6pld

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:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-n4k4h5

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-o9smb

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-dfbb75

Properties & Relations (7)Properties of the function, and connections to other functions
SmoothDensityHistogram effectively plots the distribution function of SmoothKernelDistribution:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-r9xh2x

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-rf9cb4

Use DensityHistogram to plot the data in discrete bins:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-hjt9j0

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-h0e9a6

Use SmoothDensityHistogram and SmoothHistogram3D for bivariate data:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-uzqufc

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-g8qcz1

Use SmoothHistogram for univariate data:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-h59lwt

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-vgklg

Use GeoSmoothHistogram for geographic data:

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-4m8gqf

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-nbn1n3

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-f84fhv

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

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-ev75i

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-bs5zy7

https://wolfram.com/xid/0bzpv1cy9r1fv37u6-bk0bgr

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
]}
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
]}