How to get two windows with different plots

孤者浪人 提交于 2019-12-20 11:09:56

问题


When we have a window with plots, is there a way to tell R to display a new plot in a new window?


回答1:


Create a new one:

plot(1:10)
x11()            # This has aliases on different OSes
plot(10:1)



回答2:


plot(1:1)
dev.new()
plot(2,2)
dev.set(dev.prev()) # go back to first
title(main="test dev 1")

dev.set(dev.next()) # go to second
title(main="test dev 2")



回答3:


You might actually want to partition the window instead so you can have mutuple plots in the same window if you are comparing them:

The following will create 3 horizontal partitions:

par(mfrow = c(3,1))

So with 3 plots it will look like the following in a single Window:



来源:https://stackoverflow.com/questions/6916129/how-to-get-two-windows-with-different-plots

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!