Hi, I desperately try to do s.th. like m=1.23455 sig=0.84321 plot(1,1) text(0.8,1,sprintf("<Sigma>=%1.2f?%1.2f",m,sig)) where actually the greek letter should appear for Sigma. I have tried all sorts of combinations with expression and paste etc. but could not work it out. Maybe someone has an idea and can help me. Thanks a lot+ Thomas
Try text(0.8,1,bquote("<"*sigma*">"==.(round(m,2))*"?"*.(round(sig,2)))) ?bquote ?plotmath On 5 June 2010 11:36, Thomas Bschorr <bschorr at phys.ethz.ch> wrote:> Hi, > > I desperately try to do s.th. like > > m=1.23455 > sig=0.84321 > > plot(1,1) > > text(0.8,1,sprintf("<Sigma>=%1.2f?%1.2f",m,sig)) > > where actually the greek letter should appear for Sigma. > I have tried all sorts of combinations with expression and paste etc. but could not work it out. Maybe someone has an idea and can help me. > > Thanks a lot+ > > Thomas > > ______________________________________________ > 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. >
The ?plotmath page and the example " ## How to combine "math" and numeric variables :" should be helpful...?>>> Thomas Bschorr <bschorr at phys.ethz.ch> 05/06/2010 10:36:42 >>>Hi, I desperately try to do s.th. like m=1.23455 sig=0.84321 plot(1,1) text(0.8,1,sprintf("<Sigma>=%1.2f?%1.2f",m,sig)) where actually the greek letter should appear for Sigma. I have tried all sorts of combinations with expression and paste etc. but could not work it out. Maybe someone has an idea and can help me. Thanks a lot+ Thomas ______________________________________________ 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. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}