This:
ggplot(Data, aes(x = Bla), bins = 30, labels = TRUE, format(x, scientific = FALSE)) +
geom_histogram()
does not work. I want to suppress the scientific notation (e.g. 1.0e+07). Any ideas? Thanks!
This:
ggplot(Data, aes(x = Bla), bins = 30, labels = TRUE, format(x, scientific = FALSE)) +
geom_histogram()
does not work. I want to suppress the scientific notation (e.g. 1.0e+07). Any ideas? Thanks!
You can use options(scipen = 999)
before you plot.
This will disable scientific notation in general and not only in your x-axis.
There are a couple of options apart from options(scipen = 999)
which you may want to avoid if you don't want set this for all charts.
ggplot(Data, aes(x = Bla), bins = 30) +
geom_histogram() +
scale_x_continuous(labels = ~ format(.x, scientific = FALSE))
or
ggplot(Data, aes(x = Bla), bins = 30) +
geom_histogram() +
scale_x_continuous(labels = scales::comma)
Instead of scales::comma
, the scales
packages also offers
which are handy if you have financial data or dates.