Skip to content
Prev 725 / 7420 Next

labelling graph axes: sub/superscript

On Tue, 2009-07-28 at 12:09 +0100, Oliver, Rebecca wrote:
dat <- data.frame(x = rnorm(100), y = rnorm(100))
plot(y ~ x, data = dat,
     ylab = expression(italic(Anet) ~~ (mu*mol ~ m^{-2} ~ s^{-1}))) 

[the double ~~ is there to add a bit of extra spacing - the "t" looked
too close to the "(" with just one ~]

In these cases you are using plotmath, so reading ?plotmath is a must.
It contains a section on fonts and how to change them to different
families, but all font.lab does is switch between bold, plain italic
etc., which can all be done using things like italic() as documented
in ?plotmath.

Perhaps you can explain better with reproducible code what you want to
do or find annoying that is not covered in ?plotmath if the above
doesn't answer/help with the last part of your post?

HTH

G