gg_ShowPlotGrobs: Show component "grobs" of a ggplot2 object (and get info on...

View source: R/gg_ShowPlotGrobs.R

gg_ShowPlotGrobsR Documentation

Show component "grobs" of a ggplot2 object (and get info on grob sizes)

Description

Function to show component "grobs" of a ggplot2 object (and get info on grob sizes).

Usage

gg_ShowPlotGrobs(
  p,
  unit = "in",
  xOffset = -3,
  yOffset = -3,
  showAll = FALSE,
  showPlot = TRUE,
  verbose = 0
)

Arguments

p
  • ggplot or gtable object

unit
  • plot units ("in", "cm", etc.)

xOffset
  • x-axis offset for row size labels

yOffset
  • y-axis offset for column size labels

showAll
  • flag (T/F) to show all grobs (including grobs with physical size 0)

showPlot
  • flag (T/F) to print grob plot

verbose
  • flag (0,1,2) to print intermediate information (0=off)

Details

This function identifies scales of components in a ggplot2 object and creates an unfilled rectangle plot of the resulting components with axes reflecting the rows and columns in the gtable derived from the ggplot2 object.

See also gg_ShowPlotDims, which is similar but provides absolute scales.

Value

invisibly returns a list with elements plot - plot of object components with axes reflecting inferred sizes lyt - vector with plot width and height tbl_rows - sum_rows - tbl_cols - sum_cols -

Author(s)

William Stockhausen (william.stockhausen@noaa.gov)


wStockhausen/wtsUtilities documentation built on March 16, 2024, 10:38 a.m.