0

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!

1 Answers1

0

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 ~']'))

enter image description here

Suhas Hegde
  • 366
  • 1
  • 6
  • 13