/// <summary> /// Change the default color palette for new plottables /// </summary> public Drawing.Palette Colorset(Drawing.Palette colorset = null) { if (colorset != null) { settings.PlottablePalette = colorset; } return(settings.PlottablePalette); }
private ScottPlot.Plot TestColormap(ScottPlot.Drawing.Palette cset, int lineWidth, bool dark = false) { var plt = new ScottPlot.Plot(600, 400); for (int i = 0; i < cset.Count(); i++) { double[] ys = DataGen.Sin(51, phase: -i / Math.PI / cset.Count()); var sig = plt.AddSignal(ys, color: cset.GetColor(i)); sig.MarkerSize = 0; sig.LineWidth = lineWidth; } if (dark) { plt.Style(Style.Gray1); plt.Style(darkColor, darkColor); } plt.Title($"Colorset '{cset.Name}' has {cset.Count()} colors"); plt.AxisAuto(0); return(plt); }
/// <summary> /// Change the default color palette for new plottables /// </summary> public void Colorset(Drawing.Palette colorset) => settings.PlottablePalette = colorset;
/// <summary> /// The palette defines the default colors given to plottables when they are added /// </summary> /// <param name="palette">New palette to use (or null for no change)</param> /// <returns>The pallete currently in use</returns> public Drawing.Palette Palette(Drawing.Palette palette) { settings.PlottablePalette ??= palette; return(settings.PlottablePalette); }