1
pdf("test.pdf")
for (i in length(dis_pos)){
    fic <- chr1[ chr1$pos < dis_pos[i]+500 & chr1$pos >=dis_pos[i], ]
    plot(fic$pos,fic$count,type='h')
}
dev.off()

I wanted to plot many figures according to the length of variable dis_pos. And I just got the last figure in pdf file. I mean, If the variable dis_pos equals 12, how can I get all the 12 picture in test.pdf file, not the 12th figure?

Shixiang Wang
  • 2,147
  • 2
  • 24
  • 33

0 Answers0