public LiveDataUpdate() { InitializeComponent(); formsPlot1.Configure(middleClickMarginX: 0); // plot the data array only once and we can updates its values later formsPlot1.plt.PlotSignal(liveData); formsPlot1.plt.AxisAutoX(margin: 0); formsPlot1.plt.SetAxisLimits(yMin: -1, yMax: 2.5); // plot a red vertical line and save it so we can move it later vline = formsPlot1.plt.PlotVLine(0, Color.Red, lineWidth: 2); // customize styling formsPlot1.plt.Title("Electrocardiogram Strip Chart"); formsPlot1.plt.YLabel("Potential (mV)"); formsPlot1.plt.XLabel("Time (seconds)"); formsPlot1.plt.Grid(false); Closed += (sender, args) => { timerUpdateData?.Stop(); timerRender?.Stop(); }; }
public MouseTracker() { InitializeComponent(); formsPlot1.Plot.AddSignal(DataGen.RandomWalk(null, 100)); vLine = formsPlot1.Plot.AddVerticalLine(0, Color.Red, 1, LineStyle.Dash); hLine = formsPlot1.Plot.AddHorizontalLine(0, Color.Red, 1, LineStyle.Dash); }
public VLine PlotVLine( double x, Color?color = null, double lineWidth = 1, string label = null, bool draggable = false, double dragLimitLower = double.NegativeInfinity, double dragLimitUpper = double.PositiveInfinity, LineStyle lineStyle = LineStyle.Solid ) { VLine axLine = new VLine() { position = x, color = color ?? settings.GetNextColor(), lineWidth = (float)lineWidth, label = label, DragEnabled = draggable, lineStyle = lineStyle, }; axLine.SetLimits(dragLimitLower, dragLimitUpper, null, null); Add(axLine); return(axLine); }
public LiveDataUpdate() { InitializeComponent(); // plot the data array only once and we can updates its values later formsPlot1.Plot.AddSignal(liveData); formsPlot1.Plot.AxisAutoX(margin: 0); formsPlot1.Plot.SetAxisLimits(yMin: -1, yMax: 2.5); // plot a red vertical line and save it so we can move it later vline = formsPlot1.Plot.AddVerticalLine(0, Color.Red, 2); // customize styling formsPlot1.Plot.Title("Electrocardiogram Strip Chart"); formsPlot1.Plot.YLabel("Potential (mV)"); formsPlot1.Plot.XLabel("Time (seconds)"); formsPlot1.Plot.Grid(false); Closed += (sender, args) => { timerUpdateData?.Stop(); timerRender?.Stop(); }; this.timerUpdateData.Interval = 0.005; this.timerUpdateData.Elapsed += this.timerUpdateData_Tick; this.timerUpdateData.Start(); this.timerRender.Interval = 0.02; this.timerRender.Elapsed += this.timerRender_Tick; this.timerRender.Start(); this.runCheckbox.CheckedChanged += this.runCheckbox_CheckedChanged; this.rollCheckbox.CheckedChanged += this.rollCheckbox_CheckedChanged; }
public MouseTracker() { InitializeComponent(); wpfPlot1.plt.PlotSignal(DataGen.RandomWalk(null, 100)); vLine = wpfPlot1.plt.PlotVLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash); hLine = wpfPlot1.plt.PlotHLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash); wpfPlot1.Render(); }
public MouseTracker() { InitializeComponent(); wpfPlot1.Plot.AddSignal(DataGen.RandomWalk(null, 100)); vLine = wpfPlot1.Plot.AddVerticalLine(0, color: System.Drawing.Color.Red, style: LineStyle.Dash); hLine = wpfPlot1.Plot.AddHorizontalLine(0, color: System.Drawing.Color.Red, style: LineStyle.Dash); wpfPlot1.Render(); }
private void ToggleVisibility_Load(object sender, EventArgs e) { int pointCount = 51; double[] dataXs = DataGen.Consecutive(pointCount); double[] dataSin = DataGen.Sin(pointCount); double[] dataCos = DataGen.Cos(pointCount); sinPlot = formsPlot1.Plot.AddScatter(dataXs, dataSin); cosPlot = formsPlot1.Plot.AddScatter(dataXs, dataCos); vline1 = formsPlot1.Plot.AddVerticalLine(0); vline2 = formsPlot1.Plot.AddVerticalLine(50); formsPlot1.Refresh(); }
private void Form1_Load(object sender, EventArgs e) { vline = formsPlot1.plt.PlotVLine(1); hline = formsPlot1.plt.PlotHLine(1); formsPlot1.plt.PlotHSpan(10, 20, draggable: true); formsPlot1.plt.PlotVSpan(5, 10, draggable: true); Random rand = new Random(0); double[] xs = DataGen.Consecutive(100); double[] ys = DataGen.RandomWalk(rand, 100); sph = formsPlot1.plt.PlotScatterHighlight(xs, ys); formsPlot1.Render(); }
public Form1() { InitializeComponent(); // simulate 10 seconds of 48 kHz audio int sampleRate = 48_000; Random rand = new Random(0); double[] data = ScottPlot.DataGen.RandomWalk(rand, sampleRate * 10); Signal = formsPlot1.Plot.AddSignal(data, sampleRate); // markers to indicate where the mouse is HLine = formsPlot1.Plot.AddHorizontalLine(0, Color.Red, 1, ScottPlot.LineStyle.Dash); VLine = formsPlot1.Plot.AddVerticalLine(0, Color.Red, 1, ScottPlot.LineStyle.Dash); formsPlot1.Render(); }
public ToggleVisibility() { InitializeComponent(); int pointCount = 51; double[] dataXs = DataGen.Consecutive(pointCount); double[] dataSin = DataGen.Sin(pointCount); double[] dataCos = DataGen.Cos(pointCount); sinPlot = wpfPlot1.Plot.AddScatter(dataXs, dataSin); cosPlot = wpfPlot1.Plot.AddScatter(dataXs, dataCos); vline1 = wpfPlot1.Plot.AddVerticalLine(0); vline2 = wpfPlot1.Plot.AddVerticalLine(50); wpfPlot1.Render(); }