PairedHistogram
PairedHistogram[{x1,x2,…},{y1,y2,…}]
plots a paired histogram of the values xi and yi.
PairedHistogram[{x1,x2,…},{y1,y2,…}, bspec]
plots a paired histogram with bin width specification bspec.
PairedHistogram[{x1,x2,…},{y1,y2,…},bspec,hspec]
plots a paired histogram with bin heights computed according to the specification hspec.
PairedHistogram[{data11,…},{data21,…},…]
plots paired histograms for multiple datasets data1i and data2j.
Details and Options
- PairedHistogram[data1,data2] by default plots a paired histogram with equal bin widths chosen to approximate an assumed underlying smooth distribution of the values xi and yi.
- Data for PairedHistogram can be given in the following forms:
-
{e1,e2,…} list of elements with or without wrappers <k1y1,k2y2,… > association of keys and lengths TimeSeries[…],EventSeries[…],TemporalData[…] time series, event series, and temporal data WeightedData[…],EventData[…] augmented datasets w[{e1,e2,…},…] wrapper applied to a whole dataset w[{data1,data1,…},…] wrapper applied to all datasets - The following bin width specifications bspec can be given:
-
n use n bins {dx} use bins of width dx {xmin,xmax,dx} use bins of width dx from xmin to xmax {{b1,b2,…}} use the bins [b1,b2),[b2,b3),… 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 {b1,b2,…} - The binning specification "Log" 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[data1,data2,fb] is applied to a list of all xi and yi and should return an explicit bin list {b1,b2,…}.
- Different forms of histogram can be obtained by giving different bin height specifications hspec in PairedHistogram[data1,data2,bspec,hspec]. The following forms can be used:
-
"Count" number of elements in each bin "CumulativeCount" cumulative counts "SurvivalCount" survival counts "Probability" fraction of values lying in each bin "Intensity" count divided by bin width "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 PairedHistogram[data1,data2,bspec,fh] is applied to two arguments: a list of bins {{b1,b2},{b2,b3},…} and corresponding list of counts {c1,c2,…}. The function should return a list of heights to be used for each of the ci.
- Only values xi that are real numbers are assigned to bins; others are taken to be missing.
- In PairedHistogram[{data11,…},{data21,…},…], automatic bin locations are determined by combining all the datasets data1i and data2j.
- PairedHistogram[{…,wi[datai,…],…},{…,wj[dataj],…},…] renders the histogram elements associated with dataset datak according to the specification defined by the symbolic wrapper wk.
- Possible symbolic wrappers are the same as for BarChart and include Style, Labeled, Legended, etc.
- PairedHistogram has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1/GoldenRatio overall ratio of height to width Axes True whether to draw axes BarOrigin Bottom origin of histogram bars ChartBaseStyle Automatic overall style for bars ChartElementFunction Automatic how to generate raw graphics for bars ChartElements Automatic graphics to use in each of the bars ChartLabels None category labels for datasets ChartLayout Automatic overall layout to use ChartLegends None legends for data elements and datasets ChartStyle Automatic style for bars ColorFunction Automatic how to color bars ColorFunctionScaling True whether to normalize arguments to ColorFunction LabelingFunction Automatic how to label elements LegendAppearance Automatic overall appearance of legends PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotTheme $PlotTheme overall theme for the histogram ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the chart - The following settings for ChartLayout can be used to display multiple sets of data:
-
"Overlapped" show all the data overlapping "Stacked" accumulate the data - The arguments supplied to ChartElementFunction are the bin region {{xmin,xmax},{ymin,ymax}}, the bin values lists, and metadata {m1,m2,…} from each level in a nested list of datasets.
- A list of built-in settings for ChartElementFunction can be obtained from ChartElementData["PairedHistogram"].
- The argument supplied to ColorFunction is the height for each bin.
- With ScalingFunctions->{sx,sy}, the x coordinate is scaled using sx etc.
- Style and other specifications from options and other constructs in BarChart are effectively applied in the order ChartStyle, ColorFunction, Style and other wrappers, ChartElements, and ChartElementFunction, with later specifications overriding earlier ones.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1/GoldenRatio overall ratio of height to width Axes True 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 BarOrigin Bottom origin of histogram bars BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ChartBaseStyle Automatic overall style for bars ChartElementFunction Automatic how to generate raw graphics for bars ChartElements Automatic graphics to use in each of the bars ChartLabels None category labels for datasets ChartLayout Automatic overall layout to use ChartLegends None legends for data elements and datasets ChartStyle Automatic style for bars ColorFunction Automatic how to color bars ColorFunctionScaling True whether to normalize arguments 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 False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks 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 LabelingFunction Automatic how to label elements LabelStyle {} style specifications for labels LegendAppearance Automatic overall appearance of legends Method Automatic details of graphics methods to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False 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 histogram PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the chart Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open allclose allBasic Examples (2)
Scope (23)
Data and Layouts (11)
Specify the number of bins to use:
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:
Numeric values in an association are used as the y coordinates:
Numeric keys and values in an association are used as the x and y coordinates:
The weights in WeightedData are ignored:
Nonreal data is taken to be missing:
Wrappers (2)
Use wrappers on individual data, datasets, or collections of datasets:
Override the default tooltips:
Use PopupWindow to provide additional drilldown information:
Button can be used to trigger any action:
Styling and Appearance (4)
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:
Labeling and Legending (6)
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:
Options (44)
BarSpacing (3)
ChartBaseStyle (5)
Use ChartBaseStyle to style bars:
ChartBaseStyle combines with ChartStyle:
ChartBaseStyle combines with Style:
ChartBaseStyle combines with ColorFunction:
ColorFunction may override settings for ChartBaseStyle:
Style may override settings for ChartBaseStyle:
ChartElementFunction (5)
Get a list of built-in settings for ChartElementFunction:
For detailed settings, use Palettes ▶ ChartElementSchemes:
This ChartElementFunction is appropriate to show the global scale:
Write a custom ChartElementFunction:
Built-in element functions may have options; use Palettes ▶ ChartElementSchemes to set them:
ChartElements (8)
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:
ChartLabels (3)
By default, labels are placed on top of each bar pair:
Place group labels on each dataset:
Use Placed to control label placement:
ChartLayout (1)
ChartLayout is overlapped by default:
ChartLegends (2)
ChartStyle (3)
Use ChartStyle to style bars:
Use "Gradient" colors from ColorData:
Use "Indexed" colors from ColorData:
ColorFunction (3)
Use ColorFunctionScaling->False to get unscaled height values:
ColorFunction overrides styles in ChartStyle:
Use ColorFunction to combine different style effects:
ColorFunctionScaling (1)
By default, scaled height values are used:
Use ColorFunctionScaling->False to get unscaled height values:
LabelingFunction (5)
Use automatic labeling by values through Tooltip and StatusArea:
Use symbolic positions to control label placement:
Symbolic positions outside the bar:
Use the given chart labels as arguments to the labeling function:
PerformanceGoal (3)
Applications (3)
Properties & Relations (5)
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:
Text
Wolfram Research (2010), PairedHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/PairedHistogram.html (updated 2015).
CMS
Wolfram Language. 2010. "PairedHistogram." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/PairedHistogram.html.
APA
Wolfram Language. (2010). PairedHistogram. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PairedHistogram.html