[SCOTTPLOT/WINFORM] Plot 클래스 : AddSignalXYConst 메소드를 사용해 시그널 XY 차트 그리기
ScottPlot/WinForm 2022. 2. 26. 22:12728x90
반응형
728x170
▶ MainForm.cs
using System;
using System.Windows.Forms;
using ScottPlot;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : Form
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
Plot plot = new Plot(800, 600);
Random random = new Random(0);
int pointCount = 100_000;
double[] yValueArray = new double[pointCount];
double[] xValueArray = new double[pointCount];
for(int i = 1; i < yValueArray.Length; i++)
{
yValueArray[i] = yValueArray[i - 1] + random.NextDouble() - 0.5;
xValueArray[i] = xValueArray[i - 1] + random.NextDouble();
}
plot.AddSignalXYConst(xValueArray, yValueArray);
this.formsPlot.Reset(plot);
this.formsPlot.Refresh();
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
댓글을 달아 주세요