With the new version ggplot2 and scales, I can\'t figure out how to get axis label in scientific notation. For example:
x <- 1:4
y <- c(0, 0.0001, 0.00
As per the comments on the accepted solution, OP is looking to format exponents as exponents. This can be done with the trans_format and trans_breaks functions in the scales package:
library(ggplot2)
library(scales)
x <- 1:4
y <- c(0, 0.0001, 0.0002, 0.0003)
dd <- data.frame(x, y)
ggplot(dd, aes(x, y)) + geom_point() +
scale_y_log10("y",
breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))