[R] plot subscript text and percentage symbol in graph label axis

baptiste auguie baptiste.auguie at googlemail.com
Fri Oct 2 14:10:41 CEST 2009


try this,

plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~"%"))


baptiste

2009/10/2 e-letter <inpost at gmail.com>:
> Readers,
>
> I am unable to plot a label consisting of both subscript text and
> percentage (%) symbol:
>
> x<-(1:10)
> y<-(200:191)
> plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~%))
> Error: syntax error, unexpected ERROR in
> "plot(x~y,ylab=expression(~degree~C),xlab=expression(x~%)"
>
> It seems that % is a special character in R? I have looked in the
> introductory manual but can see no reference to reserved characters.
>
> Yours,
>
> rhelpatconference.jabber.org
> r251
> mandriva2008
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list