I would like to write on the x and y axes of the ggplot the following expression: LE flux [W m-1]. My solution is:
xlab(expression("LE flux [W m""~"^{-2}"~]")).
I don't understand why it doesn't work. Appreciate any help!
I would like to write on the x and y axes of the ggplot the following expression: LE flux [W m-1]. My solution is:
xlab(expression("LE flux [W m""~"^{-2}"~]")).
I don't understand why it doesn't work. Appreciate any help!
I think you should do labs(x = expression('blah'))
library(dplyr)
library(ggplot2)
ggplot(mtcars, aes(wt, mpg))+
geom_point() +
labs(x = expression('LE flux [W'~ m^-2 ~']'), y = expression('LE flux [W'~ m^-2 ~']'))