R语言画图——structure图一页多图

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()


结果如下:在这里插入图片描述

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值