Population Arrangement
The user may customize where data is drawn relative to the bar or box. Centering everything can be used to achieve an effect where data points are drawn over the bar or box.
ScottPlot.Plot myPlot = new();
for (int i = 0; i < 5; i++)
{
double[] values = Generate.RandomNormal(10, mean: 3 + i);
var pop = myPlot.Add.Population(values, x: i);
pop.MarkerAlignment = HorizontalAlignment.Center;
pop.BarAlignment = HorizontalAlignment.Center;
pop.Marker.Shape = MarkerShape.OpenDiamond;
pop.Marker.Color = Colors.Black.WithAlpha(.5);
pop.Bar.FillColor = Colors.Gray;
pop.Bar.LineWidth = 2;
pop.Width = 0.5;
}
// refine appearance of the plot
myPlot.Axes.Margins(bottom: 0);
myPlot.HideGrid();
myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Population Plot category
