服务热线
178 0020 3020
install.packages("ggthemes")
install.packages("reshape2")
library(reshape2)
library(ggplot2)
library(ggthemes)
mydata1<-read.csv(file.choose(1))
mydata1<-melt(mydata1,id.vars="Products",variable.names="Time",variable.names="index")
ggplot(mydata1, aes(x=variable,y=value,fill=Products))+geom_bar(stat="identity", position="dodge", color= "black") +labs(x="Time", y="Index")+ ggtitle("R2-09")+scale_fill_wsj("rgby")+theme_wsj(color="blue")
library(ggplot2)
mydata2<-read.csv(file.choose(1))
ggplot(mydata2,aes(x=社区,fill=态度))+geom_bar(position="stack")+labs(x="count",y="社区")+coord_flip()+scale_fill_brewer(palette="Pastel1")+ggtitle("R2-09")
附件