Box Plot Groups
Each collection of boxes added to the plot gets styled the same and appears as a single item in the legend. Add multiple bar series plots with defined X positions to give the appearance of grouped data.
ScottPlot.Plot myPlot = new();
List<ScottPlot.Box> boxes1 = new() {
Generate.RandomBox(1),
Generate.RandomBox(2),
Generate.RandomBox(3),
};
List<ScottPlot.Box> boxes2 = new() {
Generate.RandomBox(5),
Generate.RandomBox(6),
Generate.RandomBox(7),
};
var bp1 = myPlot.Add.Boxes(boxes1);
bp1.LegendText = "Group 1";
var bp2 = myPlot.Add.Boxes(boxes2);
bp2.LegendText = "Group 2";
myPlot.ShowLegend(Alignment.UpperRight);
myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Box Plot category
