Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Superscript and subscript axis labels in ggplot2 [duplicate]

I need an axis label in ggplot2 which reads "Assimilation (μmol CO2 m-2 s-1)" with the 2 of CO2 as subscript and the -2 and -1 as superscript. Thanks.

like image 879
Becky Martin Avatar asked Dec 12 '14 14:12

Becky Martin


1 Answers

You could try

library(ggplot2)
qplot(uptake, data = CO2) +
   xlab(bquote('Assimilation ('*mu~ 'mol' ~CO[2]~ m^-2~s^-1*')'))

enter image description here

like image 176
akrun Avatar answered Oct 13 '22 23:10

akrun