public void ExecuteRecipe(Plot plt) { Random rand = new Random(0); int pointCount = 1_000_000; double[] sine = DataGen.Sin(pointCount, 3); double[] noise = DataGen.RandomNormal(rand, pointCount, 0, 0.5); double[] ys = sine.Zip(noise, (s, n) => s + n).ToArray(); double[] xs = new double[pointCount]; double currentX = 0; for (int i = 0; i < pointCount; i++) { if ((i % 100000) < 10) { currentX += 10; } else { currentX += 0.0001; } xs[i] = currentX; } plt.AddSignalXY(xs, ys); }
public void ExecuteRecipe(Plot plt) { (double[] xs, double[] ys) = DataGen.RandomWalk2D(new Random(0), 5_000); var sig = plt.AddSignalXY(xs, ys); sig.OffsetX = 10_000; sig.OffsetY = 100; }
public void ExecuteRecipe(Plot plt) { (double[] xs, double[] ys) = DataGen.RandomWalk2D(new Random(0), 5_000); var sigxy = plt.AddSignalXY(xs, ys); sigxy.FillBelow(); plt.Margins(x: 0); }
public void ExecuteRecipe(Plot plt) { (double[] xs, double[] ys) = DataGen.RandomWalk2D(new Random(0), 5_000); var sigxy = plt.AddSignalXY(xs, ys); sigxy.StepDisplay = true; sigxy.MarkerSize = 0; plt.SetAxisLimits(110, 140, 17.5, 27.5); }
public void ExecuteRecipe(Plot plt) { var rand = new Random(0); double[] ys = DataGen.RandomWalk(rand, 200); double[] xs = DataGen.Consecutive(200); var sig = plt.AddSignalXY(xs, ys); sig.MarkerShape = MarkerShape.filledTriangleUp; sig.MarkerSize = 10; plt.SetAxisLimits(100, 120, 10, 15); }
public void ExecuteRecipe(Plot plt) { var rand = new Random(0); int pointCount = 1_000_000; double[] sine = DataGen.Sin(pointCount, 3); double[] noise = DataGen.RandomNormal(rand, pointCount, 0, 0.5); double[] ys = sine.Zip(noise, (s, n) => s + n).ToArray(); double[] xs = Enumerable.Range(0, pointCount) .Select(x => (double)x) .Select(x => x > 500_000 ? x + 1_000_000 : x) .Select(x => x > 200_000 ? x + 100_000 : x) .ToArray(); plt.AddSignalXY(xs, ys); }
public void ExecuteRecipe(Plot plt) { // generate random, unevenly-spaced data Random rand = new Random(0); int pointCount = 100_000; double[] ys = new double[pointCount]; double[] xs = new double[pointCount]; for (int i = 1; i < ys.Length; i++) { ys[i] = ys[i - 1] + rand.NextDouble() - .5; xs[i] = xs[i - 1] + rand.NextDouble(); } plt.AddSignalXY(xs, ys); }
public void ExecuteRecipe(Plot plt) { Random rand = new(0); int pointCount = 5_000; double[] sine = DataGen.Sin(pointCount, 3); double[] noise = DataGen.RandomNormal(rand, pointCount, 0, 0.5); double[] ys = sine.Zip(noise, (s, n) => s + n).ToArray(); double[] xs = new double[pointCount]; double x = 0; for (int i = 0; i < pointCount; i++) { bool lowDensityPoint = (i % 1_000) < 10; x += lowDensityPoint ? 10 : .05; xs[i] = x; } plt.AddSignalXY(xs, ys); }
public void ExecuteRecipe(Plot plt) { (double[] xs, double[] ys) = DataGen.RandomWalk2D(new Random(0), 5_000); plt.AddSignalXY(xs, ys); }