1

I know how to get superscripted text in a plot lable using parse or expression when I want to put X raised to the Y, e.g.

plot(c(1,2),c(1,2),type='n',xlab=expression("example " (m^2)))

this works fine, as per these these pages

How do I include a superscript to texts on a plot on R?

Superscript in R

But I want to have a lable that reads (^o C) where ^o is the raised degree symbol. trying to delete the m part always gives me an error:

unexpected '^'
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86

2 Answers2

2

You can use

plot(c(1,2),c(1,2),type='n',xlab=expression("example " (degree~C)))

enter image description here

or if no space is required between degree and C

plot(c(1,2),c(1,2),type='n',xlab=expression("example " (degree*C)))

enter image description here

For details check

?plotmath
missuse
  • 19,056
  • 3
  • 25
  • 47
1

Is this what you want?

plot(c(1,2),c(1,2),type='n',xlab=expression("example " (paste(""^o, "C"))))

enter image description here

mt1022
  • 16,834
  • 5
  • 48
  • 71