Skip to content

SP5: Constant values in a Scatter results in an empty graph #2714

@ahmad-qamar

Description

@ahmad-qamar

Bug Report: Constant values in a Scatter results in an empty graph in SP5

Issue: Basically, if data in either the X or Y axis all have the same value, instead of drawing the points in a straight line, it results in an empty plot with no tick or markings in that axis as well. It does pose a serious issue in case of handling numerous plots where such values are important to be conveyed to the end user.

Reproducing:
Use the following code to reproduce this:

            Plot plot = new();
            plot.XAxis.Label.Text = "X";
            plot.YAxis.Label.Text = "Y";

            double[] dataX = { 1, 4, 9, 16, 25 };
            double[] dataY = { 5, 5, 5, 5, 5 };
            plot.Add.Scatter(dataX, dataY);

            plot.Save("plot.png", 400,300);         

Result:
image

System Details

  • ScottPlot Version: 5.0.5-beta
  • Operating System: Windows 11
  • Application Type: Console
  • .NET Version: 6

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