Discussion:
Symbols and superscript/subscripts in axis labels
waschbaer
2011-03-30 03:17:47 UTC
Permalink
Hi @all

I would like to have a symbol and some sub- and superscripts in my y-
axis labels. Any idea how to solve that? The label should look like:

d15N-NO3 (%0) which means the delta 15 N isotopic ratio of NO3 in per-
mille.

Any suggestions are greatly appreciated.

Cheers
Martin
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
waschbaer
2011-03-30 03:18:30 UTC
Permalink
Hi @all

I would like to have a symbol and some sub- and superscripts in my y-
axis labels. Any idea how to solve that? The label should look like:

d15N-NO3 (%0) which means the delta 15 N isotopic ratio of NO3 in per-
mille.

Any suggestions are greatly appreciated.

Cheers
Martin
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Dennis Murphy
2011-03-30 03:56:13 UTC
Permalink
Hi:

I know little about chemistry so the expression may end up as nonsense, but
it's an excuse to show how to use subscripts and superscripts in an
expression. See ?plotmath for a list of operators and a useful example.

df <- data.frame(x = 1, y = 1)
ggplot(df, aes(x, y)) + geom_point() +
xlab(expression(paste(delta^{15},'N-N',O[3]~'(%0)')))

paste() is used here to separate the mathematical parts of the expression
from the text parts; the tilde represents insertion of space.

HTH,
Dennis
Post by waschbaer
I would like to have a symbol and some sub- and superscripts in my y-
d15N-NO3 (%0) which means the delta 15 N isotopic ratio of NO3 in per-
mille.
Any suggestions are greatly appreciated.
Cheers
Martin
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
More options: http://groups.google.com/group/ggplot2
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
waschbaer
2011-03-30 06:30:13 UTC
Permalink
Thanks for that...that works like a charm.

Martin
Post by Dennis Murphy
I know little about chemistry so the expression may end up as nonsense, but
it's an excuse to show how to use subscripts and superscripts in an
expression. See ?plotmath for a list of operators and a useful example.
df <- data.frame(x = 1, y = 1)
ggplot(df, aes(x, y)) + geom_point() +
xlab(expression(paste(delta^{15},'N-N',O[3]~'(%0)')))
paste() is used here to separate the mathematical parts of the expression
from the text parts; the tilde represents insertion of space.
HTH,
Dennis
Post by waschbaer
I would like to have a symbol and some sub- and superscripts in my y-
d15N-NO3 (%0) which means the delta 15 N isotopic ratio of NO3 in per-
mille.
Any suggestions are greatly appreciated.
Cheers
Martin
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example:http://gist.github.com/270442
More options:http://groups.google.com/group/ggplot2
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Loading...