首页 > 编程语言 > 详细

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

时间:2017-08-20 14:30:06      阅读:1405      评论:0      收藏:0      [点我收藏+]

转载: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 的柱状图

原文:http://www.cnblogs.com/renping/p/7399830.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!