|
SOLUTIONS
|
Search for all pages containing DensityHistogram
BUILT-IN MATHEMATICA SYMBOL
DensityHistogram
DensityHistogram[{{x1, y1}, {x2, y2}, ...}]
plots a density histogram of the values
.
DensityHistogram[{{x1, y1}, {x2, y2}, ...}, bspec]
plots a density histogram with bins specified by bspec.
DensityHistogram[{{x1, y1}, {x2, y2}, ...}, bspec, hspec]
plots a density histogram with bin densities computed according to the specification hspec.
Details and OptionsDetails and Options
- 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:
-
n use n bins {w} use bins of width w {min,max,w} use bins of width w from min to max {{b1,b2,...}} use bins 
Automatic determine bin widths automatically "name" use a named binning method {"Log",bspec} apply binning bspec on log transformed data fb apply 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[data, fb] is applied to a list of all
, and should return an explicit bin list
. In DensityHistogram[data, {fx, fy}], 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[data, bspec, hspec]. 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 fh heights obtained by applying fh to bins and counts - The function fh in DensityHistogram[data, bspec, fh] 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. - DensityHistogram has the same options as Graphics with the following additions and changes:
-
AspectRatio 1 ratio of height to width ChartBaseStyle Automatic overall style for tiles ChartElementFunction Automatic how to generate raw graphics for tiles 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 LabelingFunction Automatic how to label elements Method Automatic the method to use for refining the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize 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 ScalingFunctions None how 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.
- With ScalingFunctions->{sx, sy, sz}, the
-coordinate is scaled using
etc. - Style and other options are effectively applied in the order ChartBaseStyle, ColorFunction, and ChartElementFunction, with later specifications overriding earlier ones.
New in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »






