[R] How to show the symbol of Angstrom ?

xiang li xiangli at gila-fw.bioengr.uic.edu
Tue Sep 14 17:10:06 CEST 2004


Paul, Thank you very much! They all works!
Sean

On Tue, 14 Sep 2004, Paul Murrell wrote:

> Hi
> 
> 
> xiang li wrote:
> > Also, I am wondering if there is any source where the expressions of 
> > many symbols are collected.
> > Thanks you very much!!!
> 
> 
> (Assuming you mean draw the angstrom symbol on a plot ...)
> 
> There are several ways:
> 
> (i) Specify the character code in octal.  Assuming ISO Latin 1 encoding, 
> something like ...
>    plot(1, type="n")
>    text(1, 1, "\305")
> ... or ...
>    grid.newpage()
>    grid.text("\305")
> ... should work.  That should be ok on default setups for Windows and 
> Unix.  On the Mac it might have to be "\201" (untested)  See, e.g., 
> http://czyborra.com/charsets/iso8859.html#ISO-8859-1 (Unix)
> http://www.microsoft.com/typography/unicode/1252.gif (Windows)
> http://kodeks.uni-bamberg.de/Computer/CodePages/MacStd.htm (Mac)
> for other standard "symbols".
> 
> (ii) Use a mathematical expression.  This won't look as good because the 
> ring and the A are not a single coherent glyph, but it should work 
> "everywhere" ...
>    plot(1, type="n")
>    text(1, 1, expression(ring(A)))
> ... or ...
>    grid.newpage()
>    grid.text(expression(ring(A)))
> ... demo(plotmath) shows the range of things you can do with this approach.
> 
> (iii) Use a hershey font (again, should work on all platforms and 
> encodings) ...
>    plot(1, type="n")
>    text(1, 1, "\\oA", vfont=c("sans serif", "plain"))
> ... or ...
>    grid.newpage()
>    grid.text("\\oA", gp=gpar(fontfamily="HersheySans"))
> ... demo(Hershey) shows the symbols available with this approach.
> 
> Hope that helps.
> 
> Paul
> 

-- 


Li, Xiang (Sean)                      | xiangli at gila.bioengr.uic.edu
Dept of Bioengineering, SEO, MC 063   | ph:   (312) 355-2520
University of Illinois at Chicago     | fax:  (312) 996-5921 
Chicago, IL  60607-7052, USA          |




More information about the R-help mailing list