SharpPlot Reference > SharpPlot Methods > DrawHistogram Method

SharpPlot.DrawHistogram Method

Construct a histogram plot from data and class-interval property.


sp = new SharpPlot(180,120);
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,
sp.HistogramStyle = HistogramStyles.NormalCurve|HistogramStyles.SurfaceShading;
sp.ClassInterval = 2;
sp.SetPenWidths(new int[] {1,3});

The short tutorial illustrates several ways to display a typical frequency distribution.



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 (the test data used in the tutorial simply sums several throws of 3 dice which follows this shape very well), 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.

Histograms can be drawn with a fitted Normal curve, which is often a good way to check if the underlying data really does have the assumed distribution.

See also ...

Histograms for distributions | SharpPlot Members | SharpPlot.HistogramStyle Property

Send comments on this topic
© Dyalog Ltd 2021