How to separate two plots in R?

前端 未结 6 1688
耶瑟儿~
耶瑟儿~ 2020-11-29 02:34

Whenever I run this code , the first plot would simply overwrite the previous one. Isnt there a way in R to separate to get two plots ?

plot(pc)
title(main=         


        
6条回答
  •  没有蜡笔的小新
    2020-11-29 03:08

    An alternative answer is to assign the plot as an object, then you can display it when you want i.e

    abcplot<-plot(pc) title(main='abc',xlab='xx',ylab='yy')
    
    sdfplot<-plot(pcs) title(main='sdf',xlab='sdf',ylab='xcv')
    
    abcplot # Displays the abc plot
    sdfplot # Displays the sdf plot
    abcplot # Displays the abc plot again
    

提交回复
热议问题