I am plotting the following data:
library(ggplot2)
library(scales)
data <- data.frame(x = 1:3, y = 1:3)
ggplot(data, aes(x, y)) +
geom_point() +
scale_y_continuous(name = paste("y value (*", math_format()(-4), ")", sep = ""))
I am not satisfied with the y-axis label. I want * to be changed to multiplicatio sign (real multiplication sign rather than letter x). I also want -4 raised to power of 10. The desired y-axis title is as below:
I am not sure how to realized these. Thank you.
Using plotmath:
ggplot(data, aes(x, y)) +
geom_point() +
ylab(expression(y~value~(phantom()%*%10^{-4})))