我做了下面的图表

使用命令
boxplot(tstats,names=c(expression(bar(x)),"","med(x)","","mad(x)","",
var(x)","",expression(q[.75]-q[.25]),""),
col=rep(c("wheat","chocolate"),5))
abline(h=2,col="steelblue",lty=2)
abline(h=-2,col="steelblue",lty=2)
title(main="normal data")但我想把共享的名字放在两个盒子(小麦和巧克力)的中间。如何修改第一个轴标签?
发布于 2012-03-26 04:49:47
这样的代码应该可以做您想做的事情:
##Some dummy data
dd = data.frame(values = rnorm(40), type=LETTERS[1:4])
##Don't plot the axes labels
##but add in the "plot frame"
boxplot(dd$values ~ dd$type, axes=FALSE,
frame.plot=TRUE, ylim=c(-4, 4))
##Now add in the y-axis
axis(2, seq(-4,4,by=2))
##Add in the x-axis at points: 1.5 and 3.5
axis(1, c(1.5,3.5), c("Med", "Mad"))https://stackoverflow.com/questions/9863783
复制相似问题