R:Boxplot - 如何向下移动 x 轴标签? [英] R: Boxplot - how to move the x-axis label down?
本文介绍了R:Boxplot - 如何向下移动 x 轴标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#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"))
是我的代码,它可以完成工作,但是当我旋转 x 轴标签时,会阻碍 x 轴标题.你们中有人知道将标题下移的方法吗?
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.
谢谢.马蒂亚斯
推荐答案
我会设置 xlab=""
并在之后使用 mtext
添加它.因此,您要么使用 line
参数将其放在标签下方的底部,要么完全更改侧面以将其放在图的顶部.
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)
这篇关于R:Boxplot - 如何向下移动 x 轴标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文