R/grid.R

Defines functions grob_shift_viewport

#' @importFrom rlang %||%
grob_shift_viewport <- function(grob, x = NULL, y = NULL) {
  vp <- grob$vp %||% return(grob)
  if (!is.null(x)) {
    vp$x <- vp$x + x
  }
  if (!is.null(y)) {
    vp$y <- vp$y + y
  }
  grob$vp <- vp
  grob
}

Try the ggragged package in your browser

Any scripts or data that you put into this service are public.

ggragged documentation built on Oct. 10, 2024, 1:07 a.m.