Superscript and subscript axis labels in ggplot2 [duplicate]

不羁的心 提交于 2019-11-27 00:11:00

问题


This question already has an answer here:

  • Subscript letters in ggplot axis label 2 answers

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.


回答1:


You could try

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



来源:https://stackoverflow.com/questions/27445452/superscript-and-subscript-axis-labels-in-ggplot2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!