转载:http://www.cnblogs.com/xudongliang/p/7283733.html

 

data <- data.frame(mean = c(10, 15), sd = c(12, 17))
rownames(data) <- c("case", "control")

par(lwd = 2)
b <- barplot(data$mean, names.arg = rownames(data), col = c("red", "blue"), ylim = c(0, 25), axes = F, font = 2)
arrows(b[1], data$mean[1], b[1], data$sd[1], angle = 90)
arrows(b[2], data$mean[2], b[2], data$sd[2], angle = 90)
lines( x = c(b[1], b[1], b[2], b[2]), y = c( data$sd[1] * 1.05 , data$sd[2] * 1.1, data$sd[2] * 1.1, data$sd[2] * 1.05), lty = 2)
text( x = b[1] + (b[2] - b[1]) / 2, y = data$sd[2] * 1.1, label = "****", cex = 2, adj = c(0.5, 0))
axis(side = 2, lwd = 2, font = 2, cex = 1.5)

 

6、R语言绘制带errorbar 的柱状图

相关文章:

  • 2021-12-26
  • 2021-11-22
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-07-02
猜你喜欢
  • 2022-12-23
  • 2021-08-07
  • 2021-08-20
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案