-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SignalXY: last point sometimes does not get rendered #3812
Comments
This is reproducible and only affects "high density mode" using ScottPlot;
namespace Sandbox.WinForms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
int count = 1000;
double[] xs = Generate.Consecutive(count);
double[] ys = Generate.RandomWalk(count);
ys[^1] = -100;
formsPlot1.Plot.Add.SignalXY(xs, ys);
}
} |
Interestingly, it's only the very last point, and only about half the frames. It "flickers" as you zoom horizontally. using ScottPlot;
namespace Sandbox.WinForms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
int count = 1000;
double[] xs = Generate.Consecutive(count);
double[] ys = Generate.RandomWalk(count);
ys[0] = -100;
ys[499] = -100;
ys[999] = -100;
var sig = formsPlot1.Plot.Add.SignalXY(xs, ys);
sig.MarkerShape = MarkerShape.OpenCircle;
sig.MarkerColor = Colors.Black;
sig.MarkerSize = 10;
}
} |
I'm pretty sure the issue is in here ScottPlot/src/ScottPlot5/ScottPlot5/DataSources/SignalXYSourceDoubleArray.cs Lines 156 to 187 in 6468dbe
|
I'm thinking the issue is here: ScottPlot/src/ScottPlot5/ScottPlot5/DataSources/SignalXYSourceDoubleArray.cs Lines 170 to 175 in 6468dbe
For the last point, it's possible where the last pixel column contains a single value, so start and stop index positions will be the same |
This fix introduced a bug with rotated SignalXY plots that can be demonstrated with the following code (I'm using the WPF Sandbox here): '''
''' It looks like the last point (which should be at X = 0, Y = 51, is being plotted without cooridnate rotation (i.e. at X = 51 and Y = 0). |
(resolves issue discussed in ScottPlot#3812
* Bugfix in end-point interpolation for rotated SignalXY * Bugfix for lastpoint coordinates in rotated SignalXY plottables (resolves issue discussed in #3812 * Bug fix for inverted Axes when finding last pixel for SignalXY plots * Update CHANGELOG.md --------- Co-authored-by: Scott W Harden <swharden@gmail.com>
Perhaps because a binning issue?
The text was updated successfully, but these errors were encountered: