Change plot line thickness in ScottPlot

615 views Asked by At

How can I change the plot line thickness in ScottPlot? And preferably also point thickness.

I've tried:

var plt = new Plot(1000, 500);
plt.AddScatter(times, temperatures, Color.Blue);
plt.LineWidth = 4;

But LineWidth apparently only works for signal plots (where AddSignal() is used instead of AddScatter()).

1

There are 1 answers

0
Ben On BEST ANSWER

You can do this through the constructor:

plt.AddScatter(times, temperatures, Color.Blue, lineWidth: lineWidth, markerSize: markerSize)

Based on this example here: https://scottplot.net/cookbook/4.1/category/plottable-scatter-plot/#custom-lines

For what it's worth, setting LineWidth does work, but it looks like you tried to set the linewidth of the plotting window rather than the actual scatter plot. This should work better:

var plt = new Plot(1000, 500);
var scat = plt.AddScatter(times, temperatures, Color.Blue);
scat.LineWidth = 4;
scat.MarkerSize = markerSize;

If you need more, you might want to check out the ScatterPlot docs. The docs haven't been available for very long unfortunately, but now that they're here they're a great source: https://scottplot.net/doc/v4/api/ScottPlot.Plottable.ScatterPlot.html