有人知道将地块嵌入其他地块以产生类似下面的模型的一般方法吗?
Does anybody know of a general way to embed plots into other plots to produce something like the mockup below?
我知道您可以按照此说明在晶格中使用print(..., more=TRUE, positions=...)来完成此操作问题,我想ggplot也可以解决这个问题(但我对ggplot不太满意).问题是我想将使用标准图形包的生存包中的规则图嵌入到格子图中.
I know that in lattice you can do it with print(..., more=TRUE, positions=...) as explained in this question, and I guess ggplot has a solution to it aswell (but I'm not very good with ggplot). The problem is that I want to embed a regular plot from the survival package that use the standard graphics package into a lattice plot.
提前谢谢!
推荐答案您可以尝试使用gridBase软件包,该软件包提供了一些功能,用于集成基础图形和基于网格的图形(包括grid和ggplot2).下面的示例将基本图形图嵌入晶格图内.
You could try the gridBase package which provides some functionality for integrating base and grid-based graphics (including lattice and ggplot2). The example below embeds a base graphics plot inside of a lattice plot.
library(lattice) library(gridBase) library(grid) plot.new() pushViewport(viewport()) xvars <- rnorm(25) yvars <- rnorm(25) xyplot(yvars~xvars) pushViewport(viewport(x=.6,y=.8,width=.25,height=.25,just=c("left","top"))) grid.rect() par(plt = gridPLT(), new=TRUE) plot(xvars,yvars) popViewport(2)此处有更多详细信息: casoilresource.lawr.ucdavis.edu/drupal/节点/1007 在这里: cran.r-project/web/packages/gridBase/vignettes/gridBase.pdf
More detail here: casoilresource.lawr.ucdavis.edu/drupal/node/1007 And here: cran.r-project/web/packages/gridBase/vignettes/gridBase.pdf
更多推荐
在地块中嵌入微型地块
发布评论