Example #1
0
        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();
        }
Example #2
0
        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");
        }