服务热线
178 0020 3020
> library(ggplot2)
> library("reshape2")
> library("ggthemes")
> R1<-read.csv("/Users/LUCY/Desktop/科研狗R语言第二期/2-3/R2-3.1.csv")
> R2<-melt(R1,id.vars='Products',measure.vars=c("Q1th","Q2nd","Q3rd","Q4th"))
> ggplot(R2,aes(variable,value,fill=Products))+geom_bar(stat='identity',position='dodge')+theme_economist() + scale_fill_wsj('rgby')+xlab('Time')+ggtitle('R2-14')
ggplot(R3,aes(x=distr,fill=factor(R3$attitude)))+geom_bar(position='stack')+coord_flip()+ggtitle('R2-14')+scale_fill_discrete(name="态度",labels = c("赞成","反对"))+theme(text=element_text(family="STKaiti",size=12))
附件