- 1、本文档共8页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
R语言 barplot基本教程
require(grDevices) # for colours[对色彩] tN - table(Ni - stats::rpois(100, lambda=5)) r - barplot(tN, col=rainbow(20)) #- type = h plotting *is* barplot[ - 类型=“H”图*是*barplot] lines(r, tN, type=h, col=red, lwd=2) barplot(tN, space = 1.5, axisnames=FALSE,+ sub = barplot(..., space= 1.5, axisnames = FALSE)) barplot(VADeaths, plot = FALSE)[1] 0.7 1.9 3.1 4.3 barplot(VADeaths, plot = FALSE, beside = TRUE) [,1] [,2] [,3] [,4][1,] 1.5 7.5 13.5 19.5[2,] 2.5 8.5 14.5 20.5[3,] 3.5 9.5 15.5 21.5[4,] 4.5 10.5 16.5 22.5[5,] 5.5 11.5 17.5 23.5 mp - barplot(VADeaths) # default[默认] tot - colMeans(VADeaths) mp[1] 0.7 1.9 3.1 4.3 tot Rural Male Rural Female Urban Male Urban Female 32.74 25.18 40.48 25.28 text(mp, tot + 3, format(tot), xpd = TRUE, col = blue) barplot(VADeaths, beside = TRUE,+ col = c(lightblue, mistyrose, lightcyan,+ lavender, cornsilk),+ legend = rownames(VADeaths), ylim = c(0, 100)) VADeaths Rural Male Rural Female Urban Male Urban Female50-54 11.7 8.7 15.4 8.455-59 18.1 11.7 24.3 13.660-64 26.9 20.3 37.0 19.365-69 41.0 30.9 54.6 35.170-74 66.0 54.3 71.1 50.0 title(main = Death Rates in Virginia, font.main = 4) hh - t(VADeaths)[, 5:1] mybarcol - gray20 hh 70-74 65-69 60-64 55-59 50-54Rural Male 66.0 41.0 26.9 18.1 11.7Rural Female 54.3 30.9 20.3 11.7 8.7Urban Male 71.1 54.6 37.0 24.3 15.4Urban Female 50.0 35.1 19.3 13.6 8.4 mybarcol[1] gray20 mp - barplot(hh, beside = TRUE,+ col = c(lightblue, mistyrose,+ lightcyan, lavender),+ legend = colnames(VADeaths), ylim= c(0,100),+ main = Death Rates in Virginia, font.main = 4,+ sub = Faked upper 2*sigma error bars, col.sub = mybarcol,+ cex.names = 1.5) segments(mp, hh, mp,
您可能关注的文档
- Romantic法兰西.ppt
- Rop 简介.ppt
- roseonly策划书最终版.doc
- RSLogix 5&500 软件介绍.ppt
- RSLogix Emulator 5000 手册.doc
- RSLogix_5000_仿真软件使用方法.doc
- RSTP,讲述RSTP相较于STP的新增元素,如端口状态、端口角色、协商过程.ppt
- RT-qPCR(实时荧光定量PCR).ppt
- RUP统一软件过程.ppt
- R程序Lecture4 因子、列表、数据框、及输入输出.ppt
- 2025年校园安全保障:新能源电动巡逻车选购指南及成本效益分析.docx
- 2025年医药冷链物流风险分析与智能化温度监控技术实施策略研究报告.docx
- 2025年厨房用品电商仓储自动化升级项目进度监控与调整报告.docx
- 2025年法律在线服务平台盈利潜力与风险评估报告.docx
- 白皮书深度解析:2025年中国数字经济产业政策与区域经济协调发展.docx
- 无人机蜂群军事战术与指挥系统创新研究.docx
- 中国适老化改造行业政策环境分析与机遇把握报告.docx
- 2025年AI芯片在数字货币交易领域的应用与安全性分析报告.docx
- 2025年全球新兴产业布局与颠覆性技术创新趋势研究报告.docx
- 2025年半导体制造超精密加工技术标准化与产业发展报告.docx
文档评论(0)