在R中更改轴标题的大小?

时间:2018-03-10 20:42:05

标签: r boxplot axis-labels

我已经为盒子图写了这段代码。我正在改变x和y轴的轴标题的大小,但它没有改变。我寻找各种答案并尝试但没有得到任何改变。有人可以帮帮我吗?

Sradmi<-read_xlsx("Boxplot.xlsx", sheet = 16)
par(family="serif")
boxplot(Sradmi, main ="Solar radiation (miroc_miroc5)", cex.axis=1.2, cex.lab=2, cex.main=1, col="red", ylim = c(10, 30), ann=FALSE)
mtext(side = 1, text = expression(bold("Months")),line=2.5)
mtext(side = 2, text = expression(bold("Solar radiation (MJ/m"^"2"*")")), line=2.5)

1 个答案:

答案 0 :(得分:0)

好像你正在使用mtext来放置轴标签。在这种情况下,您需要更改mtext

中的cex参数
boxplot(Sradmi, main ="Solar radiation (miroc_miroc5)", cex.axis=1.2, cex.lab=2, cex.main=1, col="red", ylim = c(10, 30), ann=FALSE)
mtext(side = 1, text = expression(bold("Months")),line=2.5, cex=1.2)
mtext(side = 2, text = expression(bold("Solar radiation (MJ/m"^"2"*")")), line=2.5, cex=1.2)