码迷,mamicode.com
首页 > 其他好文 > 详细

ggplot2叠加不同图层

时间:2015-01-22 00:03:05      阅读:992      评论:0      收藏:0      [点我收藏+]

标签:

数据sample

flanking mean sd CNV
0 365 15 955
100 367 15 1018
200 369 15.1 1025
300 370 15.1 1027
400 372 15.2 1031
500 373 15.3 1032
600 375 15.3 1033
700 377 15.3 1034
800 378 15.4 1034
900 380 15.4 1037

a=read.table("SDandCNV.txt",header=T)
lilbrary("ggplot2")
pd <- position_dodge(.1) 
layer1=ggplot(a,aes(flanking,mean))+geom_point(position=pd,size=3)+geom_errorbar(aes(ymin=mean-sd,ymax=mean+sd),width=0.1,position=pd)+geom_line(position=pd)
layer2=geom_line(aes(y=CNV))
layer3=geom_point(aes(y=CNV),shape=1)
layer1+layer2+layer3

 

ggplot2叠加不同图层

标签:

原文地址:http://www.cnblogs.com/yumtaoist/p/4240199.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!