Re: [R] greek symbols using pch

From: Earl F. Glynn <>
Date: Tue 11 Oct 2005 - 01:12:02 EST

"FISCHER, Matthew" <> wrote in message

> In a plot, can I specify pch to be a greek symbol? (I looked at
> show.pch() in the Hmisc package but couldn't see the right symbols in
> If not, I guess I can get around this using text(x,y,expression()).

I'm not sure where this is explained very well. Having ?font give a clue about this would be nice.

Use font=5, the symbol font. To see what's in font=5:

par(font=5, las=1)
  main="Symbols in Font=5",
  xlab="", ylab="",xaxt="n", yaxt="n")
axis(BOTTOM<-1, at=0:15, 1:16)
axis(LEFT <-2, at=0:15)
abline(v=0.5 + 0:14,

       h=0.5 + 0:14, col="grey", lty="dotted")

# pch index of any cell is 16*row + column for(i in 0:255)
  x <- i %%16;
  y <- i %/% 16;

The Greek letters are from 65 to 90 and 97 to 122 in this font.

Here are random points with Greek letters as the plot character:

# Use Greek letter for plot characters from font=5 plot(0:1, 0:1, axes=F, type="n", xlab="", ylab="",   main="Greek plotting characters")
points(runif(100), runif(100), pch=c(65:90, 97:122))

Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Oct 11 01:25:54 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:41 EST