s-news
[Top] [All Lists]

[S] Summary: Greek Letters in Axis Labels

To: s-news@wubios.wustl.edu
Subject: [S] Summary: Greek Letters in Axis Labels
From: Michael Prager <Mike.Prager@noaa.gov>
Date: Tue, 27 Jul 1999 11:27:31 -0400
Sender: owner-s-news@wubios.wustl.edu
A few weeks ago, I asked how one could, using SPLUS 4.5 Professional under 
Windows NT, include Greek letters and symbols in axis labels of "traditional" 
graphs made from S scripts.  I received several answers.

1. Carl H. Nelson said:

 >> I think an easy solution to your problem can be accomplished through
downloading and installing R. Unlike S, R allows mathematical notation
including subscripts and Greek letters in the labels of graphs. The code
for generating your graphs should translate directly from S to R. So it
should be pretty painless to generate the graphs with the labels you want
in R. <<

I did download R, and I must say it is quite impressive.  After a bit of 
fiddling, I got the Greek letters successfully into the captions, though doing 
that is not clearly documented.  I also found that S-PLUS and R syntax is *not* 
exactly the same with respect to "cex":  the scope of "cex" seems less within 
an S script, so that had I stated it repeatedly for different plot elements.  
In that case, R multiplied them, so I wound up with *huge* characters.  Easy to 
fix, of course.

2. Given that the graphs were going into a LaTeX document, Stephen Smith 
recommended using PSFRAG and gave instructions for locating it at CTAN.  I was 
hoping for a more general solution, so I have not tried this yet.  

3. Steve Wofsy suggested:

For use in postscript files, you can use the functions given in

ftp://ftp.as.harvard.edu/pub/exchange/scw/SUPSUB.S

It uses approximate font metrics that go into afm.std in the scripts.
You can adjust if you need to.

I just found Steve's email this morning, buried in my inbasket, but intend to 
try it very soon.  Thanks, Steve!

4. Alan Zaslavsky suggested:

 >> Take a look at my function mixed.text() and relatives in the 
 >> "postscriptfonts" archive on Statlib.  The purpose of these functions is to 
 >> allow simple math-like strings including subscripts and superscripts, mixed 
 >> in greek letters and other fonts, changes of character size, etc. within a 
 >> label.
Use mixed.mtext() for marginal labels such xlab.

These are designed for Unix, originally, but should work reasonably well
in an NT environment with a little tinkering.  The main issue in
switching to NT is that the afm() function expects to read and manipulate
the PostScript font metric files using Unix utilities.  You can bypass
this in the current version by setting an option,

        options(mixed.text.screen=T)

[...] <<

I downloading this, then located and downloaded a Unix emulator to unpack the 
Shell archive, then deadlines took over, and R provided an immediate fix, so I 
have not yet implemented Alan's suggestion.


In summary, I was surprised at how high the geek factor is in the available 
solutions to this obvious requirement of scientists (the target of S-PLUS, 
no?).  The easiest method (at least for me) was to install R!  I've been told 
that StatSci holds that editable graphics solve this problem, but I would 
hardly agree with that.

Finally, I again thank all who sent their suggestions!  I have them archived 
and will be exploring them further as time allows.

-- 
Michael Prager      <Mike.Prager@noaa.gov>
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516  USA

Standard Disclaimers: Opinions expressed here are personal 
and are not otherwise represented.  Any use of tradenames
in the above does not constitute a NOAA endorsement.
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] Summary: Greek Letters in Axis Labels, Michael Prager <=