0

我使用iplot(更准确地说是 GCR)为我的分析绘制多个交互式条形图和散点图。但是,对于每次执行,必须手动安排窗口(也可能存在我不知道的自动方式)。

所以,我想知道是否有办法将它们放在一个大窗口中。我知道可以给出窗口大小和位置。但是,它们将有多个令人讨厌的窗口。

谢谢

4

1 回答 1

0

我不知道有一种方法可以将两个情节合二为一。但是,您可以使用iplot.location()and iplot.size,正如您已经提到的:

library(iplots)
iPlotsRestore <- function(setting) { 
  invisible(lapply(1:length(iplot.list()), function(x) {
    iplot.location(x = setting[[x]]['x'], y = setting[[x]]['y'], plot = iplot.list()[[x]])
    iplot.size(width = setting[[x]]['width'], height = setting[[x]]['height'], plot = iplot.list()[[x]])
  }))
}

iplotsStore <- function() {
  setting <- lapply(iplot.list(), function(x) iplot.location(plot = x))
  return(setting)
}


setting <- list(structure(c(542, 527, 432, 416), .Names = c("x", "y", "width", "height")), structure(c(10, 0, 432, 416), .Names = c("x", "y", "width", "height")), structure(c(885, 0, 873, 609), .Names = c("x",  "y", "width", "height")))
invisible(lapply(iplot.list(), iplot.off)) # delete all plots
ihist(iris$Sepal.Width) # recreate three demo plots
ihist(iris$Petal.Length)
ihist(iris$Sepal.Width)
iPlotsRestore(setting) # recreate old window settings

用于IplotsStore获取所有当前绘图的窗口参数列表,您可以将其保存到文件中。用于iPlotsRestore再次恢复窗口参数。

于 2015-07-21T08:46:28.853 回答