ScottPlot places unnecessary markers on (0,0) and (x,0) coordinates

282 Views Asked by At

I have been trying to plot a simple line in ScottPlot, which starts at (0,y1) and ends at (x,y2) where both y1,y2 != 0. However, ScottPlot still places markers at the coordinates (0,0) and (x,0) .

How can I make the chart without these coordinates so that only the remaining points are graphed?

Example:

enter image description here

My Code:

WpfPlot plt = new();

double[] xs = xPoints.ToArray();
double[] ys = yPoints.ToArray();

double[] paddedXs = ScottPlot.Tools.Pad(xs, cloneEdges: true);

plt.Plot.AddScatter(paddedXs, ScottPlot.Tools.Pad(ys), lineWidth: 2, color: Color.Blue);
1

There are 1 best solutions below

0
On BEST ANSWER

I figured it out. It was due to the padding. After I used regular non-padded x values, both (0,0) and (x,0) dissappeared.