在 (r)gedit 中显示多个 R 图形窗口
我正在使用 gedit 的 rgedit 插件。 我想允许一次显示多个图形(绘图)窗口。目前,每当我 plot()
时,绘图都会覆盖之前的绘图窗口。
I'm using rgedit plugin for gedit.
I would like to allow more than one graphic (plot) window to show at a time. Currently, whenever I plot()
, the plot overwrites the previous plot window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只是为了补充德克的答案,您还可以在同一窗口中绘制多个图形,请查看
?par
,特别是mfrow
参数例如
par( mfrow=c(2,2))
将为您提供 2x2 的绘图布局。对于更复杂的布局,请参阅
?split.screen
和?layout
要在设备之间切换,您可以执行以下操作:
请注意,尽管您存储在
dev 中的设备编号.1
、dev.2
和dev.3
大多数情况下是连续的 (1,2,3),您应该始终使用dev.cur< /code> 获取设备的编号,因为您不能安全地假设它们恰好是 1,2,3 等...(您可能打开了其他设备)
Just to add to Dirk's answer, you can also plot multiple graphs in the same window, look at
?par
, in particular at themfrow
parameterFor instance
par(mfrow=c(2,2))
will give you a 2x2 layout for your plot.For more complex layouts see
?split.screen
and?layout
To switch between devices you can do:
Note that, although the devices numbers you're storing in
dev.1
,dev.2
anddev.3
will mostly be sequential (1,2,3) you should always usedev.cur
to get the number of the device, as you cannot safely assume they will be exactly 1,2,3 etc... (you may have other devices open)或者您可以打开一个新的控制台选项卡,但这并不像 Dirk 和 nico 提出的建议那么优雅(您必须提交代码两次)。
Or you could open a new console tab, but this isn't as elegant (you have to submit your code twice) as the suggestions made by Dirk and nico.
不是
gedit
问题,而是一般 R 功能 - 使用x11()
(或windows()
)创建新的绘图设备。然后您可以使用 dev.set() 等在它们之间切换。
Not a
gedit
issue but a general R feature -- usex11()
(orwindows()
) to create new plot devices.You can then use
dev.set()
et al to flip between them.