我尝试使用表达式(),它与noraml图一起使用,但我的尝试失败了:任何想法?
我想写:μgCO2(下标2) - C m-2 (上标-2) h-1 (上标-1)< / em>的
完美运作:
plot(CO2~water_content, data=gases, ylab = expression(paste("µg ", CO[2], " - C ", m^-2, " ", h^-1, sep="")))
失败:
qplot(factor(vegetation_dummy),CO2,facets=sampling~biochar,geom=c('boxplot'),data=gases_PL)+theme_bw()+xlab('Plants')+ylab = expression(paste("µg ", CO[2], " - C ", m^-2, " ", h^-1, sep=""))
非常感谢!
答案 0 :(得分:11)
您的命令失败,因为语法错误
qplot(..) ... + ylab = expression(...)
你需要像'+ ylab(...)'
这样的东西例如:
data(diamonds)
qplot(carat, depth, data=diamonds, facets = cut~color, geom='boxplot') +
ylab(expression(paste("µg ", CO[2], " - C ", m^-2, " ", h^-1, sep="")))