public Form1() { InitializeComponent(); Random Rand = new(0); int pointCount = 20; double[] xs = ScottPlot.DataGen.RandomWalk(Rand, pointCount); double[] ys = ScottPlot.DataGen.RandomWalk(Rand, pointCount); Scatter1 = new(xs, ys); Scatter1.Color = formsPlot1.Plot.Palette.GetColor(0); Scatter1.MarkerSize = 7; Scatter1.DragEnabled = true; formsPlot1.Plot.Add(Scatter1); Scatter2 = new(); Scatter2.Color = formsPlot1.Plot.Palette.GetColor(1); formsPlot1.Plot.Add(Scatter2); formsPlot1.PlottableDragged += FormsPlot1_PlottableDragged; formsPlot1.Configuration.Quality = ScottPlot.Control.QualityMode.High; formsPlot1.Plot.AxisAuto(); ReInterpolate(); }
public void ExecuteRecipe(Plot plt) { double[] x = ScottPlot.DataGen.Consecutive(50); double[] y = ScottPlot.DataGen.Cos(50); var scatter = new ScottPlot.Plottable.ScatterPlotDraggable(x, y) { DragCursor = Cursor.Crosshair, DragEnabled = true, }; plt.Add(scatter); }
public void ExecuteRecipe(Plot plt) { double[] x = ScottPlot.DataGen.Consecutive(50); double[] y = ScottPlot.DataGen.Cos(50); var scatter = new ScottPlot.Plottable.ScatterPlotDraggable(x, y) { DragCursor = Cursor.Crosshair, DragEnabled = true, // controls whether anything can be dragged DragEnabledX = false, // controls whether points can be dragged horizontally DragEnabledY = true, // controls whether points can be dragged vertically }; plt.Add(scatter); }
private void UpdateOriginalData(int count = 20) { Random Rand = new Random(); double[] xs = ScottPlot.DataGen.RandomWalk(Rand, count); double[] ys = ScottPlot.DataGen.RandomWalk(Rand, count); var sp = new ScottPlot.Plottable.ScatterPlotDraggable(xs, ys); sp.MarkerSize = 10; sp.DragEnabled = true; sp.Color = formsPlot1.Plot.Palette.GetColor(0); sp.Dragged += OnPointDragged; formsPlot1.Plot.Clear(); formsPlot1.Plot.Add(sp); UpdateInterpolation(); }