I would like to write a micrometer square / cubic meter in my graph labelin ggplot, and I got an error when I add m ^ 2. The first expression is fine, but it does not contain ^ 2. My attempt to add m ^ 2 did not work because I did not see a superscript.
label
ylab (expression(paste("Surface area concentration (",mu,"m/",m^3,")", sep="")))
ylab (expression(paste("Surface area concentration (",mu,",m^2,"/,m^3,")", sep="")))
thank
This is just a problem with a quote:
library(ggplot2) qplot(mpg, wt, data = mtcars) + ylab (expression(paste( "Surface area concentration (", mu, m^2, "/", m^3, ")", sep="")))
Try the following:
qplot(0, ylab = ~ "Surface area concentration ( " * mu * m^2 / m^3 * ")")
Or, even shorter:
plot(0, ylab = ~ "Surface area concentration" (mu * m^2 / m^3)) plot(0, ylab = Surface~area~concentration (mu * m^2 / m^3))