-
Notifications
You must be signed in to change notification settings - Fork 368
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
histogram produces wrong plots #5343
Comments
@PaulWessel, the problem is with two lines changed in https://github.com/GenericMappingTools/gmt/pull/4454/files in Changing
back to
produces the old plot. |
Thanks, I will reconsider what was implemented and what it was trying to fix. |
Before I dig deeper: I see that function returning false meaning the spacing is not variable, which it is not. Does the previous code return true (which would not be correct) and somehow this makes a correct plot? |
Yes, before it returned true. So a whack-a-mole situation probably. |
So this is classic rounding behavior. If we use the pshistogram_get_bin function that assumes the bins have a fixed interval we do things like
we should do
meaning we only encounter the rounding for very large data sets? Say BIG_NUMBER is 10e6? |
See #5343 for background. By comparing a value to the array of bin boundaries we can consistently round in the same direction. However, for large data sets of more than 1 million points we will use a faster approach for equidstant bins where values that fall exactly on bin boundaries will be rounded in alternate directions per standard rounding conventions.
See #5343 for background. By comparing a value to the array of bin boundaries we can consistently round in the same direction. However, for large data sets of more than 1 million points we will use a faster approach for equidstant bins where values that fall exactly on bin boundaries will be rounded in alternate directions per standard rounding conventions.
Description of the problem
Example data: test.txt
To reproduce the bug, run:
I think the GMT 6.1.1 plot is correct and the GMT 6.2.0 plot is worng.
System information
gmt --version
): 6.2.0The text was updated successfully, but these errors were encountered: