Car*_*hen 3 statistics r boxplot
如何绘制这样的方框图:
制作订书钉,数据标记在下/上四分位数的1.5 IQR内,看起来像一个方括号.
我试过了:
bx = sapply(5:1, function(x) rnorm(100, x, sqrt(x)))
boxplot(bx, col = "gray", pch = "", boxwex = 0.3,
medlwd = rep(3, 4), medcol = rep("white", 4),
outlty = 1, outwex = 1,
whisklty = 1,
staplelty = 1, staplewex = 1,
names = paste0("mu = ", 5:1))
title(main = "n = 100")
Run Code Online (Sandbox Code Playgroud)
我不相信有可能这样做staplelty.但是,您可以将订书钉绘制为水平线并添加垂直刻度.
boxplot(iris[,1:4], outlty=1, pch="")
for(i in 1:4) {
segments(c(i-0.2,i+0.2), BP$stats[5,i], c(i-0.2,i+0.2), BP$stats[5,i] - 0.1)
segments(c(i-0.2,i+0.2), BP$stats[1,i], c(i-0.2,i+0.2), BP$stats[1,i] + 0.1)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
209 次 |
| 最近记录: |