How to make the square root symbol in axes labels?

16,516

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

Share:
16,516
user1730122
Author by

user1730122

Updated on June 25, 2022

Comments

  • user1730122
    user1730122 about 2 years

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

  • mnel
    mnel over 11 years
    +1. There is no need to look online for the help. ?plotmath will give the same help page
  • IRTFM
    IRTFM over 11 years
    I'm downvoting (the question, not the answer) because @user1730122 crossposted to r-help.