服务热线
178 0020 3020
> library("ggplot2")
> getwd()
[1] "C:/Users/Administrator/Desktop/R语言"
> a<-read.csv("R.4-1.csv")
ggplot(a,aes(x="",y=value,fill=code))+geom_bar(stat="identity",width=1)+coord_polar(theta="y")+labs(x="code",y="value")+ggtitle("R2-07")+theme(legend.title=element_blank(),legend.position="top")+theme(axis.ticks=element_blank())
>
饼图:
> library("ggplot2")
> 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-07")
附件