0

How can I write cm yr^-1 in axis label or xlab R using ggplot2 ?

I've tried:

xlab("Predicted dbh annual increment\n(cm yr^{-1})")

but failed.

Thanks for your help.

Abd Rahman

Richard Telford
  • 9,558
  • 6
  • 38
  • 51
  • You could try something like the following `xlab(bquote("Predicted dbh annual increment (cm" ~yr^{-1}~ ")"))` – steveb Jul 03 '16 at 17:02
  • Possible duplicate of [Subscript letters in ggplot axis label](http://stackoverflow.com/questions/17334759/subscript-letters-in-ggplot-axis-label) – steveb Jul 03 '16 at 17:10

1 Answers1

0

You can use the Unicode symbol of the minus and just do copy and paste: "⁻¹"

Or you can take a look at the shortcuts for all systems. For Linux it would be: "Ctrl+Shift+U"+"207b" for the minus and "circumflex"+"1" for the superscript one

Matthieu
  • 1
  • 1