This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


plots a paired histogram of the values and .
plots a paired histogram with bin width specification bspec.
plots a paired histogram with bin heights computed according to the specification hspec.
plots a paired histograms for multiple datasets and .
  • PairedHistogram by default plots a paired histogram with equal bin widths chosen to approximate an assumed underlying smooth distribution of the values and .
  • The following bin width specifications bspec can be given:
nuse n bins
{dx}use bins of width dx
{xmin,xmax,dx}use bins of width dx from to
{{b1,b2,...}}use the 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
  • 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 PairedHistogram is applied to a list of all and , and should return an explicit bin list .
  • Different forms of histogram can be obtained by giving different bin height specifications hspec in PairedHistogram. 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 PairedHistogram is applied to two arguments: a list of bins , and corresponding list of counts . The function should return a list of heights to be used for each of the .
  • Only values that are real numbers are assigned to bins; others are taken to be missing.
  • In PairedHistogram, automatic bin locations are determined by combining all the datasets and .
  • PairedHistogram renders the histogram elements associated with dataset according to the specification defined by the symbolic wrapper .
AspectRatio1/GoldenRatiooverall ratio of width to height
AxesTruewhether to draw axes
BarOriginBottomorigin of histogram bars
ChartBaseStyleAutomaticoverall style for bars
ChartElementFunctionAutomatichow to generate raw graphics for bars
ChartElementsAutomaticgraphics to use in each of the bars
ChartLabelsNonecategory labels for datasets
ChartLayoutAutomaticoverall layout to use
ChartStyleAutomaticstyle for bars
ChartLegendsNonelegends for data elements and datasets
ColorFunctionAutomatichow to color bars
ColorFunctionScalingTruewhether to normalize arguments to ColorFunction
LabelingFunctionAutomatichow to label elements
LegendAppearanceAutomaticoverall appearance of legends
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
ScalingFunctionsNonehow to scale individual coordinates
  • The arguments supplied to ChartElementFunction are the bin region , the bin values lists, and metadata from each level in a nested list of datasets.
  • The argument supplied to ColorFunction is the height for each bin.
Generate a paired histogram of two datasets:
Plot the probability density function of the datasets:
Cumulative distribution function:
Survival function:
Hazard function:
Cumulative hazard function:
Generate a paired histogram of two datasets:
Click for copyable input
Plot the probability density function of the datasets:
Click for copyable input
Click for copyable input
Cumulative distribution function:
Click for copyable input
Survival function:
Click for copyable input
Hazard function:
Click for copyable input
Cumulative hazard function:
Click for copyable input
Specify the number of bins to use:
Specify the bin width:
The bin delimiters:
The bin delimiters as an explicit list:
Use different automatic binning methods:
Use logarithmically spaced bins:
Delimit bins on integer boundaries using a binning function:
Use different height specifications:
Use a height function that accumulates the bin counts:
Bins associated with a dataset are styled the same:
Nonreal data is taken to be missing:
Use different layouts to display multiple datasets:
Control the origin of bars:
Use wrappers on individual data, datasets, or collections of datasets:
Wrappers can be nested:
Override the default tooltips:
Use PopupWindow to provide additional drilldown information:
Button can be used to trigger any action:
Use an explicit list of styles for the bars:
Use any gradient or indexed color schemes from ColorData:
ChartBaseStyle can be used to set an initial style for all chart elements:
Use built-in programmatically generated bars:
For detailed settings use PalettesChartElementSchemes:
Use symbolic positions to label the datasets:
Provide value labels for bars by using LabelingFunction:
Use Placed to control placement and formatting:
Add categorical legend entries for datasets:
Apply legends at different levels:
Use Placed to affect the positioning of legends:
By default axes are drawn:
Draw no axes:
Change the bar origin:
Use automatically determined spacing between paired bars:
Use no spacing:
Use explicit spacing between bar pairs:
Use ChartBaseStyle to style bars:
ChartBaseStyle combines with ChartStyle:
ChartBaseStyle combines with Style:
ColorFunction may override settings for ChartBaseStyle:
Style may override settings for ChartBaseStyle:
Create a pictorial chart based on any Graphics object:
Use a stretched version of the graphic:
Use explicit sizes for width and height:
Without AspectRatio->Full, the original aspect ratio is preserved:
Using All for width or height causes that direction to stretch to the full size of the bar:
Use a different graphic for each side of the chart:
Use a different graphic for each row of data:
Styles are inherited from styles set through ChartStyle etc.:
Explicit styles set in the graphic will override other style settings:
The orientation of the pictorial graphic is unaffected by BarOrigin:
Get a list of built-in settings for ChartElementFunction:
For detailed settings, use PalettesChartElementSchemes:
This ChartElementFunction is appropriate to show the global scale:
Write a custom ChartElementFunction:
Built-in element functions may have options; use PalettesChartElementSchemes to set them:
By default labels are placed on top of each bar pair:
Place group labels on each dataset:
Use Placed to control label placement:
ChartLayout is overlapped by default:
Stacked layout:
Use ChartStyle to style bars:
Give a list of styles:
Use colors from ColorData:
Use colors from ColorData:
Specify styles for each bar pair:
Generate a legend based on chart style:
Create legends for each dataset and bar pair:
Color by bar height:
Use ColorFunctionScaling->False to get unscaled height values:
ColorFunction overrides styles in ChartStyle:
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 symbolic positions to control label placement:
Symbolic positions outside the bar:
Use the given chart labels as arguments to the labeling function:
Place complete labels in tooltips:
Generate a paired bar chart with interactive highlighting:
Emphasize performance by disabling interactive behaviors:
Typically less memory is required for non-interactive charts:
Compare two different distributions:
Compare temperatures for two cities in 2009:
PairedBarChart works on lists of heights:
Histogram and SmoothHistogram can be used to visualize single datasets:
Histogram3D and SmoothHistogram3D show bivariate data as surfaces:
DensityHistogram and SmoothDensityHistogram show bivariate data as density plots:
QuantilePlot and ProbabilityPlot compare distributions to each other:
BoxWhiskerChart and DistributionChart work with many datasets:
New in 8