static void Main(string[] args) { // create data with our own routines int nPoints = 250; double[] Xs = ScottPlot.Generate.Sequence(nPoints); double[] Ys1 = ScottPlot.Generate.Sine(nPoints, 4); double[] Ys2 = ScottPlot.Generate.Sine(nPoints, 4.5, .8); // create a ScottPlot figure ScottPlot.Figure SP = new ScottPlot.Figure(); // manually set axis before drawing anything (very important) SP.AxisAuto(Xs, Ys1, 0, 0.1); // prepare by first drawing a grid SP.Grid(); // add the line to the bitmap SP.PlotLine(Xs, Ys1, "g", 5, true); SP.PlotLine(Xs, Ys2, "b", 2); // render the bitmap and save it as a file SP.SaveFig("demo.jpg"); }
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(); }
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; }