在地块中嵌入微型地块

编程入门 行业动态 更新时间:2024-10-14 08:28:39
本文介绍了在地块中嵌入微型地块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人知道将地块嵌入其他地块以产生类似下面的模型的一般方法吗?

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

更多推荐

在地块中嵌入微型地块

本文发布于:2023-05-29 03:34:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/335830.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地块

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!