How to increase font size in a plot in R?

Tim picture Tim · Nov 22, 2010 · Viewed 482.2k times · Source

I am confused. What is the right way to increase font size of text in the title, labels and other places of a plot?

For example

x <- rnorm(100)
hist(x, xlim=range(x), xlab= "Variable Label", 
     ylab="density", main="Title of plot", prob=TRUE, ps=30)

The ps argument does not change font size (but it says in R Help for ?par that it is for "the point size of text (but not symbols)".

Also is it possible to separate changing the font size from the plotting function such as hist?

Answer

Dirk Eddelbuettel picture Dirk Eddelbuettel · Nov 22, 2010

You want something like the cex=1.5 argument to scale fonts 150 percent. But do see help(par) as there are also cex.lab, cex.axis, ...