- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以在 grid
中“强制”R 基图包裹的grid.newpage
?例如,这工作正常:
library(grid)
grid.newpage()
vp1 <- viewport(x=0,y=0.5,width=0.5, height=0.5, just = c("left", "bottom"))
vp2 <- viewport(x=0.5,y=0,width=0.5, height=0.5, just = c("left", "bottom"))
pushViewport(vp1)
grid.rect()
grid.text("vp1", 0.5, 0.5)
upViewport()
pushViewport(vp2)
grid.rect()
grid.text("vp2", 0.5, 0.5)
grid.newpage()
vp1 <- viewport(x=0,y=0.5,width=0.5, height=0.5, just = c("left", "bottom"))
vp2 <- viewport(x=0.5,y=0,width=0.5, height=0.5, just = c("left", "bottom"))
pushViewport(vp1)
grid.rect()
print(plot(1,2))
grid.text("vp1", 0.5, 0.5)
upViewport()
pushViewport(vp2)
grid.rect()
print(plot(1,2))
grid.newpage
.使用
par(new=T)
也没有帮助。
最佳答案
因为没有人回答这个,我会自己做。正如 Andrie 所说,这个问题的答案是 here .您需要 gridFIG()
函数来自 gridBase
在 plot.new()
中绘制 R 基图的包而不是 grid.newpage()
:
library(grid)
library(gridBase)
plot.new()
vp1 <- viewport(x=0,y=0.5,width=0.5, height=0.5, just = c("left", "bottom"))
vp2 <- viewport(x=0.5,y=0,width=0.5, height=0.5, just = c("left", "bottom"))
pushViewport(vp1)
grid.rect()
grid.text("vp1", 0.5, 0.5)
par(new=TRUE, fig=gridFIG())
plot(1,2)
upViewport()
pushViewport(vp2)
grid.rect()
grid.text("vp2", 0.5, 0.5)
par(new=TRUE, fig=gridFIG())
plot(1,2)
关于r - 如何在 grid.newpage 中使用 R 基图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14999802/
我想知道是否可以简单地以与此不同的方式在 R markdown v2 中使用 LaTeX \newpage 命令: ```{r, results='asis', echo=FALSE} cat("\\
我正在为页面 dscan.me 编写一个爬虫。它应该用内容填充表单并使用提交输入按钮提交。我在这里没有看到任何问题,但我已经尝试了我所知道的有关 HtmlUnit 的所有内容(而且这并不算太多)。触发
我尝试使用 doc.newPage(); 在新页面中创建内容。它工作得很好,但是当我尝试在 forloop 中使用相同的东西时,它不起作用。下面是我的代码 String first="First Pa
我需要帮助来更改 ckEditor 图标:“新页面”到指向同一网站页面的简单链接。 enter image description here 最佳答案 首先,我们需要找出一种方法来选择页面中代表图标的
是否可以在 grid 中“强制”R 基图包裹的grid.newpage ?例如,这工作正常: library(grid) grid.newpage() vp1 <- viewport(x=0,y=0.
我正在尝试在 youtube 上进行网络抓取以从视频中获取信息,但是它给出了一个错误,它似乎在 requests_html 的渲染 () 中,代码如下: from requests_html impo
我正在尝试使用 puppeteer-core,但是当我运行我的代码时。 const puppeteer = require('puppeteer-core'); module.exports= run
我是一名优秀的程序员,十分优秀!