Search code examples
rgraphing

Both mathematical and Greek characters in graph label using R


I want a graph about about drug exposure to have the x-axis title "area under the curve (uM*min)", but I'm flummoxed about how to both have an actual Greek letter μ instead of the "u" and a times symbol (×) instead of "*".

I've tried

 plot(1:10, 1:10, 
 xlab = expression("AUC ("*mu*"M"*\times*"min)"))

but that doesn't work. I tried

 xlab = expression(paste("AUC ("*mu*"M", \times, "min)")))

and no go there, either. I thought of using "×" somehow, but I don't see how that would work without R thinking that I've commented out the rest of that line.

Any suggestions?


Solution

  • This is one solution using unicode: plot(0,0, xlab = "AUC (\U03BCM \U00D7 min)")

    enter image description here


    Another solution using expression: plot(0,0, xlab = expression(AUC~"("*mu*M %*% min*")"))