Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Statistical Data Analysis > Statistical Visualization > DensityHistogram >
Mathematica > Mathematics and Algorithms > Statistical Data Analysis > Statistical Visualization > DensityHistogram >
Mathematica > Visualization and Graphics > Charting and Information Visualization > Statistical Visualization > DensityHistogram >

DensityHistogram

DensityHistogram
plots a density histogram of the values .
DensityHistogram
plots a density histogram with bins specified by bspec.
DensityHistogram
plots a density histogram with bin densities computed according to the specification hspec.
  • DensityHistogram[data] by default plots a histogram with equal bins chosen to approximate an assumed underlying smooth distribution of the values .
  • The -width of each bin is computed according to the values , and the -width according to the values .
  • The following bin specifications bspec can be given:
nuse n bins
{w}use bins of width w
{min,max,w}use bins of width w from min to max
{{b1,b2,...}}use bins
Automaticdetermine bin widths automatically
"name"use a named binning method
{"Log",bspec}apply binning bspec on log transformed data
fbapply fb to get an explicit bin specification
{xspec,yspec}give different x and y specifications
  • The binning specification is taken to use the Automatic underlying binning method.
  • Possible named binning methods include:
"Sturges"compute the number of bins based on the length of data
"Scott"asymptotically minimize the mean square error
"FreedmanDiaconis"twice the interquartile range divided by the cube root of sample size
"Knuth"balance likelihood and prior probability of a piecewise uniform model
"Wand"one-level recursive approximate Wand binning
  • The function fb in DensityHistogram is applied to a list of all , and should return an explicit bin list . In DensityHistogram, fx is applied to the list of , and fy to the list of .
  • Different forms of density histogram can be obtained by giving different bin density specifications hspec in DensityHistogram. The following forms can be used:
"Count"the number of values lying in each bin
"CumulativeCount"cumulative counts
"SurvivalCount"survival counts
"Probability"fraction of values lying in each bin
"PDF"probability density function
"CDF"cumulative distribution function
"SF"survival function
"HF"hazard function
"CHF"cumulative hazard function
{"Log",hspec}log transformed height specification
fhheights obtained by applying fh to bins and counts
  • The function fh in DensityHistogram is applied to three arguments: a list of bins , a list of bins , and the corresponding 2D array of counts . The function should return an array of densities to be used for each of the .
  • Only values that consist of real numbers are assigned to bins; others are taken to be missing.
AspectRatio1ratio of height to width
ChartBaseStyleAutomaticoverall style for tiles
ChartElementFunctionAutomatichow to generate raw graphics for tiles
ClippingStyleNonehow to draw values clipped by PlotRange
ColorFunctionAutomatichow to color the plot
ColorFunctionScalingTruewhether to scale the argument to ColorFunction
FrameTruewhether to draw a frame around the plot
FrameTicksAutomaticframe tick marks
LabelingFunctionAutomatichow to label elements
MethodAutomaticthe method to use for refining the plot
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotRangeAutomaticthe range of f or other values to include
PlotRangeClippingTruewhether to clip at the plot range
PlotRangePaddingAutomatichow much to pad the range of values
ScalingFunctionsNonehow to scale individual coordinates
  • The arguments supplied to ChartElementFunction are the bin region , the bin values lists, and metadata .
  • The argument supplied to ColorFunction is the density for each bin.
Plot a density histogram for a dataset:
Plot the probability density function of the data:
Cumulative distribution function:
Survival function:
Hazard function:
Cumulative hazard function:
Plot a density histogram for a dataset:
In[1]:=
Click for copyable input
Out[1]=
 
Plot the probability density function of the data:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Cumulative distribution function:
In[3]:=
Click for copyable input
Out[3]=
Survival function:
In[4]:=
Click for copyable input
Out[4]=
Hazard function:
In[5]:=
Click for copyable input
Out[5]=
Cumulative hazard function:
In[6]:=
Click for copyable input
Out[6]=
Specify the number of bins to use:
Specify a different number of bins to use in x and y:
Specify the bin width:
Specify a different bin width to use in x and y:
Specify bin delimiters:
Specify different bin delimiters to use in x and y:
Specify bin delimiters as an explicit list:
Specify different bin delimiters to use in x and y:
Use different automatic binning methods:
Use different height specifications:
Use a height function that accumulates the bin counts over the y direction:
Nonreal data is taken to be missing:
Add labels:
Color the surface by height:
Style bins:
Use ChartBaseStyle to style bins:
ColorFunction may override settings for ChartBaseStyle:
Get a list of built-in settings for ChartElementFunction:
For detailed settings use PalettesChartElementSchemes:
Write a custom ChartElementFunction:
Color by height:
Named color gradients color in the direction:
Use brightness to correspond to height or density of a function:
Use ColorFunctionScaling->False to get unscaled height values:
Use ColorFunction to combine different style effects:
By default scaled height values are used:
Use ColorFunctionScaling->False to get unscaled height values:
Use automatic labeling by values through Tooltip and StatusArea:
Do no labeling:
Use Placed to control label placement:
Show data of each dimension on axes:
Use a box-whisker glyph to show how data distributes in each dimension:
Generate a bar chart with interactive highlighting:
Emphasize performance by disabling interactive behaviors:
Typically less memory is required for non-interactive charts:
Estimate the density of volcanic craters in western Uganda:
Volcanic crater locations:
A scaling function for labeling:
The estimated density with a scaled legend:
DensityHistogram automatically determines bins to use based on data:
DensityHistogram colors the height according to ColorFunction:
Use Histogram3D to visualize data in 3D:
Use SmoothDensityHistogram and SmoothHistogram3D to compare estimated distribution with the data:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF