-
Notifications
You must be signed in to change notification settings - Fork 53
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
Precision error in gradient #634
Comments
I found one more case with the same problem.
Specifiaction as Json{ "mapping": {}, "data": { "x": [ "first", "first", "second", "third", "third" ], "y": [ "18", "21", "21", "18", "21" ], "z": [ 3.5264934876244764E-7, 0.0974772170888232, 0.1116666955828674, 2.58687631451427E-5, 0.5 ] }, "kind": "plot", "scales": [ { "aesthetic": "fill", "scale_mapper_kind": "color_gradientn", "na_value": "#000000", "colors": [ "#DFFADC", "#C9F5D3", "#B3F2CF", "#9AEBCD", "#80DCCC", "#6DC8D2", "#61B7DB", "#5C97DB", "#5A7CD6", "#6060C7", "#674BB3", "#693799", "#6A277B", "#671D60", "#611347" ], "trans": "log10" } ], "layers": [ { "mapping": { "x": "x", "y": "y", "fill": "z" }, "stat": "identity", "width": 0.95, "position": "identity", "geom": "tile", "height": 0.95 } ] }Without Additionally, legend is definitely broken in case of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I plot tiles and lets plot interpret one of existed values as NaN
Code:
Specification as Json
{ "mapping": {}, "data": { "x": [ "first", "first", "second", "third", "third" ], "y": [ "18", "21", "21", "18", "21" ], "z": [ 3.5264934876244764E-7, 0.0974772170888232, 0.1116666955828674, 2.58687631451427E-5, 0.07896070396295593 ] }, "kind": "plot", "scales": [ { "aesthetic": "fill", "scale_mapper_kind": "color_gradientn", "na_value": "#000000", "colors": [ "#DFFADC", "#C9F5D3", "#B3F2CF", "#9AEBCD", "#80DCCC", "#6DC8D2", "#61B7DB", "#5C97DB", "#5A7CD6", "#6060C7", "#674BB3", "#693799", "#6A277B", "#671D60", "#611347" ] } ], "layers": [ { "mapping": { "x": "x", "y": "y", "fill": "z" }, "stat": "identity", "width": 0.95, "position": "identity", "geom": "tile", "height": 0.95 } ] }I expected no black tiles.
I found the source of this behaviour: because of double precision error upper end of the range is not the same as the max value of data. This code divide double by int and multiply it again, in general, it will not be the same as an original.
The text was updated successfully, but these errors were encountered: