Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            fig = new ScottPlot.Figure(pictureBox1.Width, pictureBox1.Height);
            fig.styleForm();
            fig.labelY = "value";
            fig.labelX = "time (seconds)";


            int pointCount = (int)(nud_sec.Value * sampleRate);

            double[] Ys = fig.gen.RandomWalk(pointCount);
            fig.AxisSet(0, pointCount / sampleRate, null, null);
            fig.AxisAuto(null, Ys, .9, .9);

            fig.BenchmarkThis();
            fig.PlotSignal(Ys, 1.0 / sampleRate);
            pictureBox1.Image = fig.Render();
        }
Esempio n. 2
0
        /// <summary>
        /// Stress-test PlotSignal() with 100 MILLION data points
        /// </summary>
        public static void demo_012()
        {
            // create a new ScottPlot figure
            var fig = new ScottPlot.Figure(640, 480);

            fig.labelTitle = "100 Million Point Stress-Test";
            fig.labelY     = "value";
            fig.labelX     = "time (seconds)";

            // create ONE MILLION points
            double[] Ys = fig.gen.RandomWalk(100_000_000);
            fig.AxisAuto(null, Ys, null, .9);             // resize Y to data
            fig.AxisSet(0, Ys.Length / 20e3, null, null); // resize X manually

            // plot using the FAST METHOD
            fig.BenchmarkThis();
            fig.PlotSignal(Ys, 1.0 / 20e3);

            // save the file
            fig.Save("output/demo_012.png");
        }