-
Notifications
You must be signed in to change notification settings - Fork 981
Description
There seems to be a drawing issue that happens with a PlotSignal using maxRenderIndex. On our end it can be reproduced when the there is less than one unit of space available on the right side. Example: 50 samples, maxRenderIndex set to 35. Now, if there is space on the X axis up to 36 or more, everything is fine; however if the last fitting value on the X axis is 35 itself, suddenly one additional sample is drawn on the graph. Showing a video probably explains it better:
The following code was used for above screen cap:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
double[] data = new double[100];
Random rand = new Random(0);
for (int i = 1; i <= 50; i++)
data[i] = data[i - 1] + rand.NextDouble() - .5;
plot.plt.PlotSignal(data, maxRenderIndex: 35);
plot.Render();
}The issue can also be observed in the "growing data" example of the current demo, both WinForms and WPF. Here, on the first few samples, there is one additional sample drawn as well, which is a 0 value:
I think in the growing data demo, the issue only occurs in the first few samples as at some point, the horizontal margin is larger than one X unit.
Tested in versions 4.0.48 and 4.1.5-beta.

