Histogram

Author

Eric W. Weisstein
February 22, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/Histogram.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Histogram.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Data

data=Table[Random[Integer,{1,10}],{100}]

data={7,4,9,1,10,8,1,4,9,5,2,2,4,5,1,9,9,7,9,6,9,7,1,9,2,10,7,3,8,10,3,4,3,4,6,2,7,10,9,9,1,3,10,8,2,5,1,6,8,10,2,2,8,10,6,6,9,5,1,8,6,5,8,9,3,10,2,3,8,3,3,6,6,6,8,5,6,8,6,4,6,1,7,4,9,1,1,7,1,2,1,4,6,6,2,3,2,1,4,8};

Binning

MapIndexed[{Sequence@@#2,Length[#1]}&,Split[Sort[data]]]//TableForm

V5

bins=Distribution[data,Range[10]]

Plot

V5

<<Graphics`Graphics`
<<DiscreteMath`Combinatorica`

Show[Histogram[data,
HistogramCategories->Range[11],Ticks->{Transpose[{Range[10]+.5,Range[10]}],Automatic},
DisplayFunction->Identity],PlotRange->{{1,11},All},
AxesOrigin->{1,0},
Frame->True,
DisplayFunction->$DisplayFunction]

V6

Histogram[data,{1},ChartStyle->Red,AxesOrigin->{1,0},PlotRange->{{1,11},All},PerformanceGoal->"Speed"]