Skip to contents

grid_add_rects() draws (rounded) rectangles around components of a print-and-play layout.

Usage

grid_add_rects(
  ...,
  layout = "poker_3x3",
  r = unit(0, "in"),
  gp = gpar(col = "black", fill = NA, lwd = 1)
)

Arguments

...

Ignored for now.

layout

Either a layout preset name in layout_names() or a data frame with layout data (as returned by layout_grid()).

r, gp

Passed to grid::grid.roundrect().

Value

NULL invisibly. As a side effect draws rectangles to the active graphics device.

Details

  • This function draws in inches so make sure your graphics device is "big" enough.

  • Sometimes if you use the same color as a solid background color this can be used to effectively "remove" unwanted card outlines.

Examples

grid::grid.newpage()
vp <- grid::viewport(width=8.5, height=11, default.units="in",
                     x=0.5, y=0.5, just=c("left", "bottom"))
grid::pushViewport(vp)
grid_add_rects(layout = "poker_3x3")
grid::popViewport()