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

label_scientific digits #378

Closed
AndreeWarby opened this issue Feb 1, 2023 · 1 comment
Closed

label_scientific digits #378

AndreeWarby opened this issue Feb 1, 2023 · 1 comment

Comments

@AndreeWarby
Copy link

Hi there,

When trying to use label_scientific and specifying the number of digits using digits = 2, it will not apply to numbers that are only showing 1 digit before the exponent. I also noted that in the examples provided when digits=3 is used, also doesn't appear to change anything from the example that doesn't include the digits argument (https://scales.r-lib.org/reference/label_scientific.html).

demo_continuous(c(1, 10))
demo_continuous(c(1, 10), labels = label_scientific())
demo_continuous(c(1, 10), labels = label_scientific(digits = 3))

Is there something I am missing or is there an issue with the digits argument?

@thomasp85
Copy link
Member

The digits argument works in the same way as in base::format(). It is a suggestion and a maximum number of digits. The output will not use more digits than necessary to differentiate between the output

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