4

How can I make the square root symbol to appear ceiling an axis label in R?

plannapus
  • 18,529
  • 4
  • 72
  • 94
user1730122
  • 51
  • 1
  • 1
  • 2

1 Answers1

17

Use expression(sqrt(x)), see the help file (by doing ?plotmath as mentioned in mnel's comment) for mathematical annotations in R plots.

plot(1:10,
     main='Example',
     ylab=expression(sqrt(x)))

which produces

enter image description here

Jilber Urbina
  • 58,147
  • 10
  • 114
  • 138
  • 3
    +1. There is no need to look online for the help. `?plotmath` will give the same help page – mnel Oct 08 '12 at 22:24
  • I'm downvoting (the question, not the answer) because @user1730122 crossposted to r-help. – IRTFM Oct 08 '12 at 23:53