服务热线
178 0020 3020
> library(ggplot2)
> library(reshape2)
> library(ggthemes)
> mydata1<-read.csv("D:\\learningr\\R2-3.1.csv")
> mydata1<-melt(mydata1,id.vars="Products",variable.names="Time",variable.names="index")
> ggplot(mydata1,aes(x=variable,y=value,fill=Products))+geom_bar(position = "dodge",stat="identity")+labs(x="Time",y="Index")+ggtitle("R2-03-40")+scale_fill_wsj("rgby")+theme_wsj(color="blue")
> library(ggplot2)
> mydata2<-read.csv("D:\\learningr\\R2_3_2.csv",head=TRUE)
> ggplot(mydata2,aes(社区,fill=态度))+geom_bar(position="stack")+ggtitle("R2-03-40")+labs(x="社区",y="count")+coord_flip()
附件