gtable_show: Visualise underlying gtable layout.

gtable_show_grillR Documentation

Visualise underlying gtable layout.

Description

Visualises the table structure or the names of the gtable's components.

Usage

gtable_show_grill(x, plot = TRUE)

gtable_show_names(
  x,
  plot = TRUE,
  rect.gp = grid::gpar(col = "black", fill = "white", alpha = 1/4)
)

Arguments

x

A gtable object. If given a ggplot object, it is converted to a gtable object with ggplotGrob.

plot

Logical. When TRUE (default), draws resulting gtable object on a new page.

rect.gp

Graphical parameters (gpar) for background drop.

Details

These functions are highly similar to gtable_show_layout. gtable_show_grill draws the grid of the underlying table, and places row and column indicies in the margin. gtable_show_names replaces the grobs with a semi-transparent rectangle and the component's name.

Value

Modified gtable object, invisibly.

Examples

library(ggplot2)
library(gtable)
library(grid)

p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()

gtable_show_grill(p)
library(ggplot2)
library(gtable)
library(grid)

p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()

gtable_show_names(p)

stefanedwards/lemon documentation built on Jan. 14, 2024, 5:55 a.m.