Data was not rendering correctly due to low precision rounding in dat… #353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been using your library and have been happy with it for the exception of this case. For example with an X vector: [0 , 1e-9... ... 1e-6 - 1e-9, 1e-6] with 1ns steps, all of these coordinates will round to zero instead of keeping their true precise value, due to a hidden rounding feature in the library. This causes my plots to look something like this:
To fix, I increased precision of all data strings to 10 digits. Was using data sampled at about 0.8ns and it was putting the first 10000+ points at the zero X value instead of where they should have been placed. This commit fixes the issue (at probably a small performance impact). I imagine a better fix for this would to be making the
setprecision
usertunable. Is this hard to do with the current implementation?This is what it looks like with the correct implementation.
I am using sampled data at over 1 billion samples per second (requires > 1ns x-axis accuracy), so this precision is potentially needed unless I convert the units, but it broke due to a feature I didn't even know was in the library!
Thanks,
Tim