服务热线
178 0020 3020
library("ggthemes") library(ggplot2) data <- read.csv("D:/R.4-1.csv", header = T) data1<-data[order(data$value,decreasing = TRUE),] myLabel=as.vector(data1$code) myLabel=paste(myLabel,"(",round(data1$value/sum(data1$value)*100,2),"%)",sep="") ggplot(data1,aes(x="",y=value,fill=code))+geom_bar(stat="identity",width=1)+ coord_polar(theta="y")+labs(x="value",y="city",title="R2-31")+ theme(legend.position = 'top',legend.title=element_blank(),axis.ticks=element_blank())+ scale_fill_discrete(breaks=data1$code,labels=myLabel)
library(lattice) ggplot(singer,aes(x=voice.part,y=height,fill=voice.part))+ geom_boxplot()+ theme(legend.position ='top',legend.title = element_blank())+ labs(title="R2-31")
附件