- This page contains recipes for the Style category.
- Visit the Cookbook Home Page to view all cookbook recipes.
- Generated by ScottPlot 4.1.64 on 5/17/2023
Default Plot Style
This example demonstrates the default plot style.
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Title("Default Style");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_Default.png");

Background Color
Plots have two background colors that can be individually customized. The figure background is the background of the whole image. The data background is the background of the rectangle that contains the data. Both background types support transparency, although PNG file export is required.
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(
figureBackground: Color.LightSkyBlue,
dataBackground: Color.Salmon);
plt.SaveFig("style_background.png");

Monospace Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Monospace);
plt.Title("Style.Monospace");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_monospace.png");

Blue1 Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Blue1);
plt.Title("Style.Blue1");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_blue1.png");

Blue2 Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Blue2);
plt.Title("Style.Blue2");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_blue2.png");

Light1 Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Light1);
plt.Title("Style.Light1");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_light1.png");

Gray1 Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Gray1);
plt.Title("Style.Gray1");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_Gray1.png");

Black Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Black);
plt.Title("Style.Black");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_Black.png");

Seaborn Style
Customize many plot features using style presets
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));
plt.Style(Style.Seaborn);
plt.Title("Style.Seaborn");
plt.XLabel("Horizontal Axis");
plt.YLabel("Vertical Axis");
plt.SaveFig("style_Seaborn.png");

Data Background Image
A backgorund image can be drawn behind the data area. Users to do this may want to make grid lines semitransparent.
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51), 1, Color.Yellow);
plt.AddSignal(DataGen.Cos(51), 1, Color.Magenta);
Bitmap monaLisaBmp = ScottPlot.DataGen.SampleImage();
plt.Style(
grid: Color.FromArgb(50, Color.White),
dataBackgroundImage: monaLisaBmp);
plt.SaveFig("misc_background_image_data.png");

Figure Background Image
A backgorund image can be drawn behind the entire figure. If you do this you likely want to make your data background transparent.
var plt = new ScottPlot.Plot(600, 400);
plt.AddSignal(DataGen.Sin(51), 1, Color.Yellow);
plt.AddSignal(DataGen.Cos(51), 1, Color.Magenta);
Bitmap monaLisaBmp = ScottPlot.DataGen.SampleImage();
plt.Style(
grid: Color.FromArgb(50, Color.White),
tick: Color.White,
dataBackground: Color.FromArgb(50, Color.White),
figureBackgroundImage: monaLisaBmp);
plt.SaveFig("misc_background_image_figure.png");
