[R] How to get special (Hershey) font symbols into plot axis labels?

Joe Mazzarella mazz at ipac.caltech.edu
Tue Mar 12 02:08:54 CET 2002


Dear R experts-

I'm running R 1.2.3 (2001-04-26) on Linux.

I need to get special symbols, such as a circle with a dot in it
as used to indicate Solar units in astronomy, into my plot axis labels.
How can I do this?

Using the R documentation on the Hershey font sets, one can plot
a Solar symbol within the world coordinates of a plot like this:

   >plot(1:10,1:10)
   >text(4,8,"\\SO",vfont=c("serif","plain"))

That works fine; however, trying to get the symbol into a plot label
with a call like this:
  >plot(BinLir,logpho,
   xlab=expression(paste("Log (",L[ir]," / ","\\SO",")")),
   ylab=expression(paste("Log ",rho," (",Mpc^-3," ",M[ir]^-1,")")),
   xlim=c(8.0,12.9),ylim=c(-9.0,-0.2),pch=1,
   vfont=c("serif","plain")
  )
gives Warning messages:
1: parameter "vfont" couldn't be set in high-level plot() function
2: parameter "vfont" couldn't be set in high-level plot() function
3: parameter "vfont" couldn't be set in high-level plot() function
4: parameter "vfont" couldn't be set in high-level plot() function

I also tried this:
  >mtext("\SO",vfont=c("serif","plain"))
and got Warning message:
Hershey fonts not yet implemented for mtext() in:
mtext(text, side, line, outer, at, adj, cex, col, font, vfont,

Finally I tried this:
  >title(xlab=expression(paste("Log (",L[ir]," / ","\SO",")")),vfont=c("serif","plain"))
and got Warning message:
parameter "vfont" couldn't be set in high-level plot() function

Another possible solution, but less general, would be to combine (over-strike)
a circle symbol with a small dot symbol. Can this be done in title(),
mtext(), or plot(x,y,xlab=[WHAT?])?

I actually need to get the Hershey "\\SO" symbol, or its equivalant, into a
plot label *subscript*. Is there any way to do this?
If not, when is this capability expected in an R update?

Any help will be greatly appreciated.

Thanks.

-Joe

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list