arrange_grobs | R Documentation |
Arrange grobs as a new grob with n * m (rows * cols)
layout.
arrange_grobs(
...,
grobs = list(...),
ncol = NULL,
nrow = NULL,
padding_ht = grid::unit(2, "line"),
padding_wt = grid::unit(2, "line"),
vp = NULL,
gp = NULL,
name = NULL
)
... |
grobs. |
grobs |
( |
ncol |
( |
nrow |
( |
padding_ht |
( |
padding_wt |
( |
vp |
( |
gp |
( |
name |
( |
A grob
.
library(grid)
num <- lapply(1:9, textGrob)
grid::grid.newpage()
grid.draw(arrange_grobs(grobs = num, ncol = 2))
showViewport()
g1 <- circleGrob(gp = gpar(col = "blue"))
g2 <- circleGrob(gp = gpar(col = "red"))
g3 <- textGrob("TEST TEXT")
grid::grid.newpage()
grid.draw(arrange_grobs(g1, g2, g3, nrow = 2))
showViewport()
grid::grid.newpage()
grid.draw(arrange_grobs(g1, g2, g3, ncol = 3))
grid::grid.newpage()
grid::pushViewport(grid::viewport(layout = grid::grid.layout(1, 2)))
vp1 <- grid::viewport(layout.pos.row = 1, layout.pos.col = 2)
grid.draw(arrange_grobs(g1, g2, g3, ncol = 2, vp = vp1))
showViewport()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.