Re: [R] greek symbols using pch

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

"FISCHER, Matthew" <mjf@ansto.gov.au> wrote in message news:283982AD9F3CD211B3AC00A0C983032F11443674@paradise.ansto.gov.au...

> 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
there).
> 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)
plot(0:15,0:15,type="n",ylim=c(15,0),
  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;
  points(x,y,pch=i+1)
}

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:

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

--
efg
Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research

______________________________________________
R-help@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
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