문제

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)?

도움이 되었습니까?

해결책

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top