Skip to content
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

Ugly zero on tick labels #31

Open
cchalmers opened this issue Jul 12, 2017 · 0 comments
Open

Ugly zero on tick labels #31

cchalmers opened this issue Jul 12, 2017 · 0 comments

Comments

@cchalmers
Copy link
Owner

cchalmers commented Jul 12, 2017

The majorTicksHelper function generates an ugly near zero number if zero is in the middle of the interval:

map floatShow $ linearMajorTicks 6 (-1, 1)
[-1.2,-0.9,-0.6,-0.3,1.110223e-16,0.3,0.6,0.9,1.2]

It looks like R deals with this by arbitrarily cutting off at 1e-14 (https://github.com/wch/r-source/blob/trunk/src/library/base/R/pretty.R#L35). I think doing integer arithmetic for the range and then converting back to Double is a better way. (which also means we can get rid of the hacky floatShow function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant