Reputation: 6489
I wish to add a label: kgC/m^2/month
to y axis of a plot in R with ^2
being displayed as superscript on m
.
Upvotes: 0
Views: 946
Reputation: 4584
plot(..., ylab = expression(kgC/m^2/month) )
You may also want to try frac
for fractions (but this doesn't always work great for axis labels)
plot(..., main = expression( frac(kgC,m^2)/month) )
Additionally, use ?plotmath
to visit help on mathematical annotations or demo(plotmath)
to run through a series of examples that demonstrate the source and output for many common mathematical expressions.
Upvotes: 3