user507 user507 - 1 year ago 115
R Question

Superscript, subscript, and greek symbol all in one axis title in ggplot2

I have the following title which I need for an axis for my plot in ggplot2:
Plant δ34S (%0).

I'm unsure how to format it so that it appears properly in this question, but I need the 34 as as a superscript and the zero as a subscript. Therefore, I need a greek symbol, a superscript, and a subscript all in one axis title.

Although I know of various ways to code using expression, bquote, paste, etc, I've had little luck incorporating all three of these special cases. Any tricks to coding this properly?

Answer Source

Try this:

plot(0, xlab = ~ paste("Plant ", delta ^ 34, "S ", ("%"[0])))


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download