R柱状图,叠图(排序)
来源:互联网 发布:淘宝买家秀怎么点赞 编辑:程序博客网 时间:2024/05/18 20:13
each<-read.csv("C:\\Users\\Administrator\\Desktop\\R\\数据三\\eachcl.csv")
cl<-colMeans(each)
mycolorscl <- c(heat.colors(11)[1:11])
barplot(cl[sort.list(cl,decreasing=T)[10:1]],names.arg=clname[sort.list(cl,decreasing=T)[10:1]],xlab="city",ylab="value",
cl<-colMeans(each)
clname<-variable.names(each)
#取变量名
cl<-as.numeric(cl)mycolorscl <- c(heat.colors(11)[1:11])
barplot(cl[sort.list(cl,decreasing=T)[10:1]],names.arg=clname[sort.list(cl,decreasing=T)[10:1]],xlab="city",ylab="value",
main="空气污染指数",col=mycolorscl[10:1],border=mycolorscl[10:1],ylim = c(0,70))
#sort.list取排序位置
叠图:(ggpl0t)
#叠图:
allend<-read.csv("C:\\Users\\Administrator\\Desktop\\R\\数据三\\allend.csv")
allggplot<-allend[2:4]
for (i in 1:9) {
test<-allend[(3*i+2):(3*i+4)]
colnames(test)<-c("how","quanty","city")
allggplot<-rbind(allggplot,test)
}
p1=ggplot(allggplot,aes(x=city,fill=how))+geom_bar(position="stack")+labs(title="各城市空气质量",y="天数")+theme(plot.title = element_text(size=20,face = "bold",hjust = 0.7))
p1
0 0
- R柱状图,叠图(排序)
- R 柱状图
- R ggplot2画柱状图
- R语言做柱状图
- R语言柱状图排序和x轴上的标签倾斜
- 用R语言画柱状图
- R画图之ggplot2-->柱状图
- 柱状图r程序示例1
- 快速排序(K&R)
- R语言 柱状图与折线图 趋势图 highcharter (hc_yAxis_multiples)图
- R语言ggplot2绘图——柱状图
- 【R语言可视化】ggplot2 自定义柱状图
- R:排序
- Echars柱状图小结(两个柱状图及合并柱状图)
- FLEX叠加柱状图(分层柱状图)
- R语言--基础总结(排序)
- D3js-对柱状图的增,删,排序
- JFreeChart柱状图(转)
- android Hid 实现注意事项
- php中的 header () 函数详解
- AngularJS在实际项目中的应用系列目录
- 汉诺塔算法--java版
- 通过TextSwitcher实现广告栏内容动画切换
- R柱状图,叠图(排序)
- DOS/BAT批处理if exist else 语句的几种用法
- 32、Power Query-利用自定义函数获取指定页数数据
- Linux中如何添加自己的路径为全局路径
- SSL 2601 网络流——飞行员配对问题
- 刘凯stm32教程第11讲总结
- 【SIP基础】SIP协议中网络角色定义
- c语言指针
- LAMP运行环境的简单搭建