[R] setting font in plots

Mark Allen mark-j-allen at hotmail.com
Thu Mar 1 14:48:33 CET 2007


Dear Reader

I am trying to change the font in a plot and after several trials finally 
came up with the following code.

plot(var_a, var_b, pch = 16, font.lab = 10, font = 10)
points(var_a, var_c, pch = 3, font = 10)
legend(0.1, 0.8, legend = c(“var_b”, “var_c”), pch = c(16,3))

It does change the font in the plot (Courier), but not in the legend that 
does not accept the "font = ..." argument. I could also not find a list with 
font names and corresponding numbers.

Surely there must be a better way to do this that I cannot seem to find. 
Looking at the R website I came across e.g. gpar() and par(), but 
unfortunately could not make it work... Is there perhaps anyone that could 
help me out here?

Thanks very much
Mark Allen

_________________________________________________________________
Advertisement: It's simple! Sell your car for just $20 at carsales.com.au



More information about the R-help mailing list