private void ReInterpolate() { int points = Math.Max(2, tbSmoothness.Value * tbSmoothness.Value / 100); (double[] xs2, double[] ys2) = Interpolation.Cubic.InterpolateXY(Scatter1.Xs, Scatter1.Ys, points); lblSmoothness.Text = $"Original points: {Scatter1.Xs.Length} \t Interpolated Points: {xs2.Length}"; Scatter2.Clear(); Scatter2.AddRange(xs2, ys2); Scatter2.MarkerSize = cbShowPoints.Checked ? 4 : 0; formsPlot1.Refresh(skipIfCurrentlyRendering: true); }
public void Test_Scatter_Mutable() { var plt = new ScottPlot.Plot(); var scatter = new ScottPlot.Plottable.ScatterPlotList(); plt.Add(scatter); TestTools.SaveFig(plt, "no_points"); scatter.Add(1, 1); plt.AxisAuto(); TestTools.SaveFig(plt, "one_point"); scatter.Add(2, 2); plt.AxisAuto(); TestTools.SaveFig(plt, "two_points"); scatter.AddRange(new double[] { 3, 4, 5 }, new double[] { 1, 6, 3 }); plt.AxisAuto(); TestTools.SaveFig(plt, "many_points"); }