Customized Bar Plot
Ultimate control of bar plot styling and positioning may be achieved by creating each bar individually, styling it as desired, and setting its exact size and location. This level of customization may be used to create extremely advanced stacked or grouped bar plots.
ScottPlot.Plot myPlot = new();
ScottPlot.Bar bar1 = new()
{
Position = 2,
Value = 5,
};
myPlot.Add.Bar(bar1);
ScottPlot.Bar bar2 = new()
{
Position = 5,
Value = 7,
ValueBase = 2,
Error = 1,
FillColor = Colors.Magenta,
LineWidth = 3,
LineColor = Colors.Navy,
FillHatch = new ScottPlot.Hatches.Striped(),
FillHatchColor = Colors.Magenta.Lighten(.2),
};
myPlot.Add.Bar(bar2);
myPlot.HideGrid();
myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Bar Plot category
