R/gtable.R

Defines functions gtable_get_grob_position gtable_set_width gtable_set_height gtable_set_grobs gtable_get_grob

gtable_get_grob <- function(x, name) {
  x$grobs[[match(name, x$layout$name)]]
}

gtable_set_grobs <- function(x, name, grob) {
  x$grobs[match(name, x$layout$name)] <- grob
  x
}

gtable_set_height <- function(x, name, height) {
  t <- x$layout$t[match(name, x$layout$name)]
  x$heights[t] <- height
  x
}

gtable_set_width <- function(x, name, width) {
  l <- x$layout$l[match(name, x$layout$name)]
  x$widths[l] <- width
  x
}

gtable_get_grob_position <- function(x, name) {
  x$layout[match(name, x$layout$name), c("t", "b", "l", "r")]
}

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.