Skip to content

SignalXY: GetColumnPixelsX floating point math error #3665

@mjazd

Description

@mjazd

Issue: This is a continuation of #3423 as #3495 didn't solve the issue I've initially reported. Some lines are not being renderend depending on the size of the image. Attached is one example, the issue also occurs at different image sizes and for different lines.

ScottPlot Version: ScottPlot v5.0.26

Code Sample:

var plot = new Plot();

plot.Axes.Left.MaximumSize = 40.5f;
plot.Axes.Left.MinimumSize = 40.5f;
plot.Axes.Right.MaximumSize = 19.5f;
plot.Axes.Right.MinimumSize = 19.5f;

plot.Add.SignalXY(
    new double[] { 1284, 1485 },
    new double[] { -2.373134328358208, -2.373134328358208 }
);

plot.Axes.SetLimits(0, 3801.1111111111113, -7.092537313432836, -0.7999999999999993);

plot.SavePng("682.png", 682, 186); // line not rendered
plot.SavePng("683.png", 683, 186); // line rendered correctly

682.png
682

683.png
683

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions