Raskolnikov
Raskolnikov

Reputation: 25

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

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);

Upvotes: 0

Views: 402

Answers (1)

Raskolnikov
Raskolnikov

Reputation: 25

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.

Upvotes: 0

Related Questions