admin管理员组文章数量:1568355
structure图一页多图
library(ggplot2)
library(grid)
library(cowplot)
## 我这里是9个文件,要画9张图,画到一页上,且是9行1列的这种
ta1 = read.table("fout.2.meanQ")
ta2 = read.table("fout.3.meanQ")
ta3 = read.table("fout.4.meanQ")
ta4 = read.table("fout.5.meanQ")
ta5 = read.table("fout.6.meanQ")
ta6 = read.table("fout.7.meanQ")
ta7 = read.table("fout.8.meanQ")
ta8 = read.table("fout.9.meanQ")
ta9 = read.table("fout.10.meanQ")
tiff(filename = "faststructure_flint.tif", width = 100, height = 50, units = "cm", compression = "lzw",res = 600)
par(mfrow=c(9,1))
par(mar=c(2,4,5,4))
barplot(t(as.matrix(ta1)),col = rainbow(2),
# xlab = "Individual",
# ylab = "Ancestry",
# main = "alldata",
# cex.names = 5,
border = NA)
mtext("flint",side = 3,line= 0,cex = 5)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta2)),col = rainbow(3),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta3)),col = rainbow(4),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta4)),col = rainbow(5),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta5)),col = rainbow(6),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta6)),col = rainbow(7),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(2,4,2,4))
barplot(t(as.matrix(ta7)),col = rainbow(8),
# xlab = "Individual",
# ylab = "Ancestry",
border = NA)
par(mar=c(5,4,2,4))
barplot(t(as.matrix(ta8)),col = rainbow(9),
# xlab = "Individual",
# cex.axis = 5,
# ylab = "Ancestry",
border = NA)
mtext("Individual",side = 1,line = 4,cex = 5)
dev.off()
结果如下:
版权声明:本文标题:R语言画图——structure图一页多图 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1725839685a1044882.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论