inst/examples/ex-smart_digits.R

smart_digits(c(0.1234, 0.5, 1.25))

smart_digits(c(1234.5678, 2000, 10000))

# A labelling function for use in a scale
library("ggplot2")

ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point() +
  scale_y_continuous(labels = smart_digits_format())

Try the ggthemes package in your browser

Any scripts or data that you put into this service are public.

ggthemes documentation built on Oct. 4, 2026, 1:06 a.m.