グラフの例:何と呼ぶのかわからないグラフ^^;

# par(family="HiraKakuProN-W3") # Mac専用
par(mgp=c(2,0.8,0))

名前 = c("あ","い","う")
上1 = c(123,125,132)
上2 = c(125,135,138)
下1 = c(82,85,82)
下2 = c(80,85,83)

plot(c(0.5,3.5), c(80,140), type="n", xlab="よこじく", ylab="たてじく", xaxt="n")
axis(1, tick=FALSE, at=1:3, label=名前)

for (i in 1:3) {
  rect(i-0.3, 下1[i], i-0.1, 上1[i], col="#4468b7")
  rect(i+0.1, 下2[i], i+0.3, 上2[i], col="#f39844")
  arrows(i-0.2, 上1[i], i+0.2, 上2[i], length=0.1, lwd=2)
  arrows(i-0.2, 下1[i], i+0.2, 下2[i], length=0.1, lwd=2)
}


Last modified: 2011-06-01 16:47:55