[R] Plots: displaying mathematical symbols in specific fonts

Ed Merkle edgar.merkle at wichita.edu
Mon Feb 20 17:11:46 CET 2006


Dear SavioRs,

I am doing some research where characters in different microsoft 
fonts serve as experimental stimuli.  Hence, in plot labels, I would 
like to display the characters in specific microsoft fonts.  I have 
figured out how to display letters and numbers, but I am having 
trouble with symbols such as capital delta.  Before I go further, I 
am using R 2.2.1 on Windows XP with everything in English.  I am 
trying to save my plot as a windows metafile.

To display different characters in verdana, for example, I first edit 
the Rdevga file so that it contains verdana.  I can then get verdana 
letters and numbers on the plot using a text() command.  Things 
within an expression() command, however, are not displayed in the 
desired font.  For example,

windows()
plot(rnorm(15),rnorm(15))
text(0,0,expression(Delta),font=10)

displays a capital delta, but it is not in font #10 within Rdevga.  I 
can get characters that have one of the first 255 ascii codes using 
chars8bit() in the sfsmisc package.  One example is the division sign:

text(0,0.2,chars8bit(247),font=10)

I have not been able to display other symbols in microsoft fonts, 
however.  Is this possible to do in R?  All replies are appreciated.

--
Ed Merkle, PhD
Department of Psychology
Wichita State University
Wichita, KS




More information about the R-help mailing list