Skip to contents

grid_add_crosshairs() draws crosshairs at the corners of components of a print-and-play layout.

Usage

grid_add_crosshairs(
  ...,
  layout = "poker_3x3",
  gp = gpar(),
  ch_width = unit(1/6, "in"),
  ch_grob = NULL
)

Arguments

...

Passed to piecepackr::grid.crosshair().

layout

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

gp, ch_width, ch_grob

Passed to piecepackr::grid.crosshair(). ch_grob defaults to piecepackr::squaresCrosshairGrob().

Value

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

Details

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

Examples

if (requireNamespace("piecepackr", quietly = TRUE) &&
    utils::packageVersion("piecepackr") >= "1.14.0-5") {
  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_crosshairs(layout = "poker_3x3")
  grid::popViewport()
}