Skip to content

Font and Color documentation

2 messages · Iyue Sung, Brian Ripley

#
Hello R-ians,

  Could someone please point me to documentation on legal font and color
specifications (and other 'par' parameters); i.e. font=6 for Times New
Roman, col='Red', etc.?  Searches in "?par", MASS (1st ed.) and other
areas were unsuccessful. I thought I remember seeing it
before...somewhere.

Thanks,
Iyue
#
This is R-specific, and R was but a glimmer of the eye when MASS (1st ed) 
was written in 1992/3.  pp. 79-84 of the current edition does have the 
information.

I think all the information you ask for is in ?par, or that points to the 
appropriate place.

Fonts are device specific.  ?par says

     'font' An integer which specifies which font to use for text.  If
          possible, device drivers arrange so that 1 corresponds to
          plain text, 2 to bold face, 3 to italic and 4 to bold italic.

and BTW, font 5 is always a symbol font.  To go beyond that you need to 
look at the documentation of the device you use.  Many devices (e.g. x11, 
windows, postscript, pdf) allow you to map fonts to those numbers.

There is a whole section on `Color Specification' in ?par, which says 
colors() gives all the known colour names, and valid numbers are from 0 to 
the size of the palette.
On Fri, 7 May 2004, Iyue Sung wrote: