[R] postscript symbols?
Marc Schwartz
MSchwartz at MedAnalytics.com
Wed Feb 2 05:37:25 CET 2005
On Tue, 2005-02-01 at 18:48 -0800, ivo_welch-rstat8303 at mailblocks.com
wrote:
> dear R wizards:
>
> is it possible to use a postscript font symbol as a plot symbol? in
> particular, I want to use the four postscript symbols for playing cards
> (club, heart, spade, diamond) as points. In LaTeX, these four are
>
> \Pisymbol{psy}{"A7} \Pisymbol{psy}{"A8}
> \Pisymbol{psy}{"A9} \Pisymbol{psy}{"A10}
>
> and what I would love to do is place them, at say, (x=1,y=1),
> (x=2,y=2), (x=3,y=3) and (x=4,y=4). Help appreciated---or merely a
> note that this is impossible.
Ivo,
This may not be exactly what you want, but...
Using the Hershey vector fonts, you can plot (using text()) a variety of
symbols.
See ?Hershey and demo(Hershey) for more information.
Here is an example:
plot(0:5, 0:5, type = "n")
text(1:4, 1:4, vfont = c("sans serif", "plain"),
labels = c("\\CL", "\\DI", "\\HE", "\\SP"), cex = 2)
The set of escaped characters in the vector for the 'labels' argument
are the codes for clubs, diamonds, hearts and spades, respectively.
HTH,
Marc Schwartz
More information about the R-help
mailing list