如何得到两个不同情节的窗户

时间:2022-01-19 12:12:18

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

当我们有一个带有情节的窗口时,有没有办法让R在一个新窗口中显示一个新的情节?

3 个解决方案

#1


29  

Create a new one:

创建一个新的:

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

#2


35  

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


19  

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:

下面将创建3个水平分区:

par(mfrow = c(3,1))

So with 3 plots it will look like the following in a single Window: 如何得到两个不同情节的窗户

有3个图在一个窗口中会是这样的:

#1


29  

Create a new one:

创建一个新的:

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

#2


35  

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


19  

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:

下面将创建3个水平分区:

par(mfrow = c(3,1))

So with 3 plots it will look like the following in a single Window: 如何得到两个不同情节的窗户

有3个图在一个窗口中会是这样的: