[R] Using the Arial font in the plot function.

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Apr 14 16:25:07 CEST 2008

You forgot to tell us your OS, so it was probably Windows.

If it is Windows, Arial is the default font for the windows() family of 
devices, including png().  However, bitmapped plots don't have text or 
fonts, just pixels.

As for postscript(), I am unaware of the existence of a PostScript font 
called 'arial'.  Arial as used on Windows and Mac OS is a truetype font, 
and although there are some ways to incorporate truetype fonts in 
PostScript, they will need to be done external to R.

But you also forgot to tell why you want such a plot, and I would have 
expected a Windows metafile (the win.metafile() device, or from a menu) 
was the right transfer medium on Windows.

On Mon, 14 Apr 2008, Todd Remund wrote:

> I would like to ensure that all the text in my plot is in the arial 
> font, like in excel and word.  I have been saving my graphics to a file 
> using the png() function, and have tried the postscript() function.  In 
> the documentation I have not been able to find a way of changing the 
> family argument to an arial font.  Does it exist?  How would I go about 
> creating a png or ps graphic using Arial?  Thank you.
> Here is the code.
> par(family= what?)
> plot(1,1, main='Main Title')
> or
> postscript('C:/Plot1.ps', family=what?)
> plot(1,1, main='Main Title')
> dev.off()
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list