ggplot2疊加不同圖層


數據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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM