Skip to content

SignalXY: does not support StepDisplay #1342

@EFeru

Description

@EFeru

Bug Report

Issue: It appears that even if StepDisplay is available for AddSignalXYConst it does not show the data as steps.

Reproducing: Just modify the Cookboox recipe SignalXYConstQuickstart to use StepDisplay:

public class SignalXYConstQuickstart : IRecipe
    {
        public string Category => "Plottable: SignalXYConst";
        public string ID => "signalxyconst_quickstart";
        public string Title => "SignalConst with X and Y data";
        public string Description =>
            "SignalXYConst is a speed-optimized plot for displaying vaues (Ys) with unevenly-spaced positions (Xs) " +
            "that are in ascending order. If your data is evenly-spaced, Signal and SignalConst is faster.";

        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();
            }

            var sig = plt.AddSignalXYConst(xs, ys);
            sig.StepDisplay = true;
        }
    }

Can it be that AddSignalXYConst is rendered differently than AddSignalConst?
Related item #1128

System Details

  • ScottPlot Version: 4.1.25
  • Operating System: Windows 10
  • Application Type: WinForms
  • .NET Version: .NET 5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions