Question

Probably a trivial question but nevertheless I couldn't find a straightforward answer for it online.

Suppose I plot this data:

plot(c(1:10),rnorm(10),xaxt="n",xlab="")

And then I want to plot my own defined x-axis labels:

x.labs=c("a","b","c","d","e","f","g","h","i","j")
axis(1,at=c(1:10),labels=x.labs)

My question is how do I adjust the font size of the labels (make x.labs bigger or smaller)?

Was it helpful?

Solution

You can use cex.axis:

plot(c(1:10), rnorm(10), xaxt = "n", xlab = "")    
x.labs = letters[1:10]
axis(1, at = c(1:10), labels = x.labs, cex.axis = 1.5)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top