public void GraphRender()
 {
     if (Xs.Length < 2 || Ys.Length < 2)
     {
         return;
     }
     SP.Clear();
     SP.Grid();
     SP.PlotLine(Xs, Ys);
     pictureBox1.BackgroundImage = SP.Render();
     this.Refresh();
 }
Example #2
0
 public void ResizeAndRedraw()
 {
     if (fig == null)
     {
         return;
     }
     fig.Resize(pictureBox1.Width, pictureBox1.Height);
     fig.FrameRedraw();
     fig.PlotLines(Xs, Ys, 1, Color.Red);
     fig.PlotScatter(Xs, Ys, 5, Color.Blue);
     pictureBox1.Image = fig.Render();
 }
Example #3
0
 public void UpdateGraph()
 {
     thinking = true;
     stopwatch.Restart();
     SP.Resize(pictureBox1.Width, pictureBox1.Height);
     SP.Clear();
     SP.Grid();
     SP.PlotLine(Xs, Ys);
     pictureBox1.BackgroundImage = SP.Render();
     this.Refresh();
     Application.DoEvents();
     stopwatch.Stop();
     MessageUpdate();
     thinking = false;
 }
Example #4
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();
        }
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            var fig = new ScottPlot.Figure(pictureBox1.Width, pictureBox1.Height);

            fig.styleForm(); // optimizes colors for forms
            fig.labelTitle = "Plotting Point Arrays";
            fig.labelY     = "Random Walk";
            fig.labelX     = "Sample Number";

            // generate data
            int pointCount = 123;

            double[] Xs = fig.gen.Sequence(pointCount);
            double[] Ys = fig.gen.RandomWalk(pointCount);
            fig.AxisAuto(Xs, Ys, .9, .9);

            // make the plot
            //fig.BenchmarkThis();
            fig.PlotLines(Xs, Ys, 1, Color.Red);
            fig.PlotScatter(Xs, Ys, 5, Color.Blue);

            pictureBox1.Image = fig.Render();
        }
Example #6
0
 private void Redraw()
 {
     pictureBox1.Image = fig.Render();
 }