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

Axis auto-centering and numerical precision #29

Open
ocramz opened this issue Dec 17, 2016 · 1 comment
Open

Axis auto-centering and numerical precision #29

ocramz opened this issue Dec 17, 2016 · 1 comment

Comments

@ocramz
Copy link

ocramz commented Dec 17, 2016

series_w

The above time series was obtained from a non-Gaussian distribution; the vertical axis is not centered at 0 but rather at that tiny value (something ^ -18).
Are the two things related and can the axis centering be rounded either by hand or automatically ?

@cchalmers
Copy link
Owner

I guess the easiest way to centre the y axis is to manually set yMin ?= -x and yMax ?= x for some x. In your case x=0.04 should do it.

Or do you mean you want the number displayed to be 0.0? There's two functions that determine the numbers displayed.

You could manually set either to get it to display 0.0 exactly.

I'm not sure the best way to deal with this case automatically. You could do something adhoc like map (\x -> if x < 1e-5 * abs (b - a) then 0 else x) ticks (where a and b are the bounds of the axis) to set values very close to zero and much smaller than the data range to exactly zero. But it's not perfect.

Another option is to calculate the majorTicksFunction using Rational so we get exact values.

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

2 participants