[R] mathematical symbols in plots

Christoph Buser buser at stat.math.ethz.ch
Thu Jan 4 08:50:32 CET 2007


Dear Sebastian

plot(1:10, 1:10)
text(4, 9, expression(paste("<", k, ">")))

should work here.

Best regards,

Christoph

--------------------------------------------------------------

Credit and Surety PML study: visit our web page www.cs-pml.org

--------------------------------------------------------------
Christoph Buser <buser at stat.math.ethz.ch>
Seminar fuer Statistik, LEO C13
ETH Zurich	8092 Zurich	 SWITZERLAND
phone: x-41-44-632-4673		fax: 632-1228
http://stat.ethz.ch/~buser/
--------------------------------------------------------------



Sebastian Weber writes:
 > Hello everyone!
 > 
 > I'm trying to plot some mathematical expression along my axis, but
 > demo(plotmath) did not have the symbol I was looking for. In particular,
 > I would like to denote the mean of an observable by writing
 > 
 > <k>
 > 
 > which I tried to enter with
 > 
 > expression(group("<", k, ">"))
 > 
 > However, my naive try doesn't work and the help doesn't want to tell me,
 > does someone know?
 > 
 > And here another one: How can I sepcify which fonts get used with which
 > R prints those mathematical symbols? Since I finally include my plots in
 > latex-documents as eps, I would love to use the same font-encoding for
 > all postscript stuff. A problem in the past has been, that R embedded
 > it's own font within the ps-files generated. These were not compatible
 > with the fonts used at the magazine where I published my document. This
 > lead to quite some confusion as \gamma became g and so on. Any solution
 > to this problem? Any hint? As I'm not too much into font-encoding, I
 > have actually no real clue where to even start searching.
 > 
 > Thank you very much for any help.
 > 
 > Greetings,
 > 
 > Sebastian Weber
 > 
 > ______________________________________________
 > R-help at stat.math.ethz.ch 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