简体   繁体   中英

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

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

Image http://i57.tinypic.com/x5oz8x.png

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

Thanks. Mathias

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM