R: Boxplot - how to move the x-axis label down?

时光毁灭记忆、已成空白 提交于 2019-12-02 06:50:24

问题


#RGR ~ Treatment:Geno boxplot
fit <- aov(Total.RGR~Treatment:Geno, data=For.R)
summary(fit)
t <- TukeyHSD(fit)
t
boxplot(Total.RGR~Treatment:Geno, 
data=For.R,las=2,ylim=c(-20,100),xlab="Treatment:Geno",ylab="RGR (mg/day)")
text(1:8, 95 ,c("a","ac","a","a","a","bd","bcd","ad"))

Is my code, it does the job, but when I rotate my x-axis labels the obstruct the x-axis title. Does any of you know of a way to move the title down?

It must be easy but I cant find anything in the reference.

Thanks. Mathias


回答1:


I would set xlab="" and add it afterwards using mtext. So, either you play with line parameter an put it the bottom under your lables Or change completely the side to put it in the top of the plot.

   mtext("Treatment:Geno", side=1, line=5)
   mtext("Treatment:Geno", side=3)


来源:https://stackoverflow.com/questions/26180178/r-boxplot-how-to-move-the-x-axis-label-down

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!