ggplot2中的上标和下标轴标签 [英] Superscript and subscript axis labels in ggplot2
本文介绍了ggplot2中的上标和下标轴标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要ggplot2中的一个轴标签,其中标有同化(μmolCO2 m-2 s-1),其中2个CO2为下标,-2和-1为上标。
Thanks。
解决方案
您可以尝试
<$ p $ (吸收,数据= CO2)+
xlab(bquote('同化('* mu〜'mol'〜CO [2]〜m) ^ -2〜s ^ -1 *')'))
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.
解决方案
You could try
library(ggplot2)
qplot(uptake, data = CO2) +
xlab(bquote('Assimilation ('*mu~ 'mol' ~CO[2]~ m^-2~s^-1*')'))
这篇关于ggplot2中的上标和下标轴标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文