R编程-实例

2020-08-06 10:33:09 浏览数 (1)

data <- read.csv("11.csv",header=T)

data <- as.matrix(data)

pdf("Number_of_cock_SNPs(M).pdf")

cols =c("royalblue2","yellow2")

par(fig=c(0.1,1,0,0.8))

barplot(data,col = cols,las=2,xlim=c(0,10),sub="Number of cock_SNPs(M)",horiz =TRUE,axis.lty = 1)

j=2.1

for (i in 2:14){

text(4,j,data[1,i],cex=0.9)

text(5,j,paste("(",round(data[1,i]/(data[1,i] data[2,i]),2),"%",")",sep=""),cex=0.9)

j=j 1.17

}

j=2.1

par(fig=c(0.1,1,0.55,1),new=TRUE)

plot(data,axes=FALSE,col="white",ann=FALSE)

legend("bottom",cex=0.8,pch=c(15,15),col=c("royalblue2","yellow2"),

legend=c("Overlapped SNPs with chicken dbSNPs","Novel SNPs"))

dev.off()

0 人点赞