R2-06 第四期-ggplot2画饼图/箱型

dean 2017-11-28 21:49:20 阅读: 388

Part 1

library(ggplot2)

data=data.frame(sub=c("A","B","C","D","E"),value=c("10","15","20","25","50"))

ggplot(data,aes(x="",y=value,fill=sub))+geom_bar(stat="identity",width=2)+coord_polar(theta="y")+labs(x="city",y="value")+ggtitle("R2-06-dean")+theme(axis.ticks = element_blank())+theme(legend.title=element_blank(),legend.position="top")+theme(axis.text.x=element_blank())

4-1.png

 Part2

library("lattice")

ggplot(data=singer,aes(x=voice.part,y=height,fill=voice.part))+geom_boxplot()+theme(legend.position='top',legend.title=element_blank())+ggtitle("R2-06-dean")


4-2.png

 
请登录后再评论
| 注册
{{item.nickname}} {{item.create_time}} {{item.floor}}楼
{{item.re_nickname}} 写于 {{item.re_time}}
切换到完整回复
科研狗 2015-2020 京ICP备16006621 科研好助手,专业的科研社交共享平台