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

Possibly confusing default for label_number_si? #301

Closed
mfherman opened this issue Jan 4, 2021 · 1 comment · Fixed by #235
Closed

Possibly confusing default for label_number_si? #301

mfherman opened this issue Jan 4, 2021 · 1 comment · Fixed by #235

Comments

@mfherman
Copy link

mfherman commented Jan 4, 2021

I've found the relatively new label_number_si() quite useful -- thanks! One thing that just caught me surprised is how it handles going from non SI to SI units. For example, at first glance, the axis below looks correct. But in fact, we get 2K because 1.5K is being rounded up as the default accuracy is 1.

library(scales)

demo_continuous(c(0, 1500), label = label_number_si())
#> scale_x_continuous(label = label_number_si())

Taking the accuracy to 0.1 works, but then you get the unnecessary decimal places at 0 and 500.

demo_continuous(c(0, 1500), label = label_number_si(0.1))
#> scale_x_continuous(label = label_number_si(0.1))

Created on 2021-01-04 by the reprex package (v0.3.0)

@davidchall
Copy link
Contributor

Hi @mfherman - this issue is fixed as part of #235

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

Successfully merging a pull request may close this issue.

2 participants