在多图窗口中绘制到特定图? [英] Plot to specific plot in multiple-plot window?
问题描述
如果我使用par(mfrow=...)
创建一个多图窗口,是否可以将数据发送到特定图(即左下角的那个")或该图始终必须是顺序图? R是否有一个像这样的软件包?
If I create a multi-plot window with par(mfrow=...)
, is it possible to send data to a specific plot (i.e. "the one in the lower left corner") or is the plotting always necessarily sequential? Is there a package for R that does something like this?
对于那些感兴趣的人来说,这个问题是由于R是一个单线程应用程序而不是实时可视化的理想选择而引起的.我有多个实时数据流从外部源进入R,这会异步生成数据(因此,数据流并非总是以相同的顺序出现).导致R每次更新时都围绕数据可视化图的顺序翻转.
For those that are interested, this problem arises out of the fact that R is a single-threaded application and is not ideal for real-time visualization. I have multiple real-time data streams coming into R from an outside source that produces the data asynchronously (and therefore the data streams don't always come in the same order). This results in R flipping around the order of the data visualization plots every time it updates.
推荐答案
您可以使用split.screen()
:
par(bg = "white") # erase.screen() will appear not to work
# if the background color is transparent
# (as it is by default on most devices).
split.screen(c(2,1)) # split display into two screens
split.screen(c(1,3), screen = 2) # now split the bottom half into 3
screen(1) # prepare screen 1 for output
plot(10:1)
screen(4) # prepare screen 4 for output
plot(10:1)
这篇关于在多图窗口中绘制到特定图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!