Home > Sample Charts > Histogram > Aggregating a Set of Samples

Aggregating a Set of Samples

The Histogram does one very simple job – it takes a large sample of values and shows how they are grouped. Many samples of data turn out to follow a bell-shaped curve called the Normal distribution, but often the shape of the plot gives some useful clues which can be hidden simply by looking at statistics such as the Mean or Range.

This first chart takes most of the SharpPlot defaults as they come and simply displays the distribution of samples.

With integer data (one ‘bin’ per value) it clearly makes sense to label the bars, rather than the tickmarks. For some reason, thise set of throws produced very few 10s, but is otherwise unremarkable.


SharpPlot sp = new SharpPlot;
sp.Heading = "Sum of 3 Dice Throws";
threedice = new int[] {9,8,6,11,9,14,11,8,9,14,12,7,6,11,15,14,11,7,5,8,7,9,6,7,12,
         7,13,8,9,13,7,7,8,12,11,16,12,9,11,12,12,12,9,14,8,9,13,11,10,13,11,13,9,
         10,10,4,14,8,9,11,12,5,12,15};
sp.HistogramStyle = HistogramStyles.SurfaceShading;
sp.SetXRange(3,18);
sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.DrawHistogram(threedice);

Worked Examples

histogram1 histogram2 histogram3 histogram4

Send comments on this topic
© Dyalog Ltd 2013