Displaying 1 result from an estimated 1 matches for "vp_path".
Did you mean:
mp_path
2005 Nov 02
0
Placing a grob in multiple viewports
Hi all,
What's the best way of placing a grob into muliple viewports? I've
been using code like:
plot_grob_matrix <- function(gm, type=deparse(substitute(gm))) {
grid <- expand.grid(x=1:nrow(gm), y=1:ncol(gm))
do.call(gList,mapply(function(x,y) editGrob(gm[[x,y]], vp=vp_path(x,
y, type)), grid$x, grid$y, SIMPLIFY=FALSE))
}
vp_path <- function(row, col, type) {
vpPath("layout", paste(type, row, col, sep="_"))
}
to place a matrix of grobs into a similar looking matrix of viewports
(constructed by another function). This works fine if the matrix...