【发布时间】:2018-06-23 04:41:28
【问题描述】:
我想使用gridSVG::grid.garnish 向我从 ggplot2 导出的 SVG 添加信息,但它一次只能在一个 grob 上工作——也就是说,您需要知道哪个 grob 是哪个。我理解I can use grid.ls to identify the structure of grobs in a plot,但是当我自己调用grid.ls 时,它只显示顶级布局:
library(tidyverse)
library(gridSVG)
p1 = quickplot(1:5, (1:5)^2)
p1g = ggplotGrob(p1)
grid.ls(p1g)
# layout
我尝试过使用不同的参数(如 recursive = TRUE 和 fullNames = TRUE),以及各种不同的基于 ggplot 的绘图,但我总是只得到顶级的 layout(或者,使用 @987654330 @、gtable[layout])。我怎样才能看到孩子 grobs?
我在 macOS 上使用 ggplot2 v. 2.2.1.9000 和 gridSVG v. 1.6-0。
【问题讨论】: