Hi, Sorry for bothering you again. I have a small question about the graph and the following is my code: xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average Power", type="l", pch=LETTERS[1:2], lty=c(1:2), main="(a)") The name of the X-axis will be ?pi0? in the graph. What should I do if I want the name of the X-axis is the Greek letter of ?pi0?? Thanks a lot! Catherine -- View this message in context: http://www.nabble.com/How-to-write-a-Greek-letter-in-a-graph--tp14957789p14957789.html Sent from the R help mailing list archive at Nabble.com.
Catherine Have a look at the help in text(), i.e. help(text) I think you are looking for something along the lines of: xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average Power", type="l", pch=LETTERS[1:2], lty=c(1:2), main="(a)", xlab=expression(pi[0])) i.e. i am assuming you want pi subscript zero. An example of using text would be text(6,10,expression( y==1.5*x+10)) HTH, Jeremy On Friday 18 January 2008 10:16:22 pm cathelf wrote:> Hi, > Sorry for bothering you again. I have a small question about the graph and > the following is my code: > > xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average > Power", type="l", pch=LETTERS[1:2], lty=c(1:2), main="(a)") > > The name of the X-axis will be ?pi0? in the graph. > > > What should I do if I want the name of the X-axis is the > Greek letter of ?pi0?? > > > Thanks a lot! > Catherine-- Jeremy Baxter, Statistics Department, Rhodes University, South Africa. Views expressed above, no matter how badly spelt, are my own... I think?
hits=-2.6 tests=BAYES_00 X-USF-Spam-Flag: NO Jeremy Baxter wrote:> Catherine > > Have a look at the help in text(), i.e. > > help(text)... and particularly help("plotmath") Uwe Ligges> I think you are looking for something along the lines of: > > xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average Power", type="l", > pch=LETTERS[1:2], lty=c(1:2), main="(a)", xlab=expression(pi[0])) > > i.e. i am assuming you want pi subscript zero. An example of using text would > be > > text(6,10,expression( y==1.5*x+10)) > > > HTH, > Jeremy > > On Friday 18 January 2008 10:16:22 pm cathelf wrote: >> Hi, >> Sorry for bothering you again. I have a small question about the graph and >> the following is my code: >> >> xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average >> Power", type="l", pch=LETTERS[1:2], lty=c(1:2), main="(a)") >> >> The name of the X-axis will be ?pi0? in the graph. >> >> >> What should I do if I want the name of the X-axis is the >> Greek letter of ?pi0?? >> >> >> Thanks a lot! >> Catherine >