Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SignalXY ジェネリック配列

SignalXY プロットはジェネリックデータ型の配列をサポートしますが、通常は double が最も高性能です。

ScottPlot.Plot myPlot = new();

// 欠損のあるサンプルデータを生成する
List<int> xList = new();
List<float> yList = new();
for (int i = 0; i < 5; i++)
{
    xList.AddRange(Generate.Consecutive(1000, first: 2000 * i).Select(x => (int)x));
    yList.AddRange(Generate.RandomSample(1000).Select(x => (float)x));
}

// この例では変換する
int[] xs = xList.ToArray();
float[] ys = yList.ToArray();

// SignalXY プロットを追加する
myPlot.Add.SignalXY(xs, ys);

myPlot.SavePng("demo.png", 400, 300);
このレシピは、SignalXY プロットカテゴリにある多数のレシピの 1 つです