[R] postscript symbols?

Marc Schwartz MSchwartz at MedAnalytics.com
Wed Feb 2 15:20:23 CET 2005


On Wed, 2005-02-02 at 10:03 -0400, Rolf Turner wrote:
> A propos of these symbols, Henrik Bengtsson (Lund University, Sweden)
> posted to this list some time ago a very useful function ``plotSymbols'',
> which can be slightly modified as follows:
> 
> plotSymbols <- function (fn=1) {
>     i <- 0:255
>     ncol <- 16
>     opar <- par(cex.axis = 0.7, mar = c(3, 3, 3, 3) + 0.1)
>     plot(i%%ncol, 1 + i%/%ncol, pch=i, font=fn, xlab = "", ylab = "", 
>         axes = FALSE)
>     axis(1, at = 0:15)
>     axis(2, at = 1:16, labels = 0:15 * 16, las = 2)
>     axis(3, at = 0:15)
>     axis(4, at = 1:16, labels = 0:15 * 16 + 15, las = 2)
>     par(opar)
> }
> 
> You can use this function to see what you get under various font
> specifications.  Of course it would help to know a priori that font
> number 5 gave you the postscript symbols!


There is a "similar" function called TestChars in the examples in 
?postscript, which I had actually reviewed last night before sending my
initial reply using the Hershey vector fonts.

However, you are correct, in that not knowing (or more correctly, not
remembering) about font=5 caused a cerebral vapor lock...  :-)

Marc




More information about the R-help mailing list