tiff(file="example.tiff", width=12, height=8,units="in", compression="lzw", res=150)
ggplot(data2,aes(x=GC3,y=GC1))+geom_smooth(method=lm,formula=y~x)+geom_point() #画你的图
dev.off()
之后完美保存本地~
有时候,我们想要多个图片在一个大图片中,怎么办呢?
使用“Rmisc”这个包就可以啦。
p<-list()
tiff(file="pr2-2.tiff", width=12, height=8,units="in", compression="lzw", res=150) ##
p[[1]]<-ggplot(atcg,aes(x=prg,y=pra)) + geom_point() + xlab("G3/(G3+C3)") + ylab("A3/(A3+T3)") + geom_hline(aes(yintercept=0.5), colour="#990000")+ geom_vline(aes(xintercept=0.5), colour="#990000")+ggtitle("Ara")
p[[2]]<-.............
multiplot(plotlist = p[1:3], cols = 3)#其实这里plotlist,直接堆叠你的p也可以,cols指有几列
dev.off()
网友评论