GitHub Repo stars

Style Helper Functions

Plots contain many objects which can be customized individually by assigning to their public properties, but helper methods exist in the Plot’s Style object that make it easier to customize many items at once using a simpler API.

This code sample is specific to ScottPlot 5 (details)
ScottPlot.Plot myPlot = new();


// visible items have public properties that can be customized
myPlot.Axes.Bottom.Label.Text = "Horizontal Axis";
myPlot.Axes.Left.Label.Text = "Vertical Axis";
myPlot.Axes.Title.Label.Text = "Plot Title";

// some items must be styled directly
myPlot.Grid.MajorLineColor = Color.FromHex("#0e3d54");
myPlot.FigureBackground.Color = Color.FromHex("#07263b");
myPlot.DataBackground.Color = Color.FromHex("#0b3049");

// the Style object contains helper methods to style many items at once

myPlot.SavePng("demo.png", 400, 300);

Edit on GitHub