linesGrob
为什么下图中没有画线(通过)?
require(gtable)
base <- gtable(widths=unit(rep(1, 2), "null"),
heights=unit(rep(1, 3), "null"))
grid.newpage()
g <- 1
for(i in 1:3) {
for(j in 1:2) {
base <- gtable_add_grob(base,
grobs=list(linesGrob(x=1:4, y=4:1),
rectGrob(gp=gpar(fill="#FF0000")),
textGrob(label=g)), i, j, name=1:3)
g <- g+1
}
}
grid.draw(base)