Home > Sample Charts > BoxPlot > Simple Boxplot of barley data

Simple Boxplot of barley data

A selection of simple Box-and-Whisker charts are developed here, all using a ‘classic’ dataset from the 1930s showing barley yields at various farms in Canada. The trials were made at 6 farms over 2 years, with 10 varieties of barley, giving 120 data-points in total. The entire dataset is shown for reference in the glossary.

The object of the trial was to see what the significant effects were, and the boxplot is an ideal way to explore relationships between variables. You might also check on the histograms of various subsets of the data, maybe using a Multiple chart to split the data by various criteria.

This chart simple takes the entire yield vector, and determines the ‘shape’ of the distribution.


SharpPlot sp = new SharpPlot;

years = (int[])_barleyyear.Clone();
yield = (double[])_barleydata.Clone();
farm = (string[])_barleyfarm.Clone();

sp.Heading = "Barley Yield (uncategorised)";
sp.SetColors(Color.Orange);
sp.XAxisStyle = XAxisStyles.ForceZero;
sp.YAxisStyle = YAxisStyles.NoAxis;
sp.BoxPlotStyle = BoxPlotStyles.Horizontal;
sp.DrawBoxPlot(yield);

Worked Examples

boxplot1 boxplot2 boxplot3 boxplot4

Send comments on this topic
© Dyalog Ltd 2013