gg_GetPlotSizeInfo: Get info on grob sizes of a ggplot2 object or derived gtable

View source: R/gg_GetPlotSizeInfo.R

gg_GetPlotSizeInfoR Documentation

Get info on grob sizes of a ggplot2 object or derived gtable

Description

Function to get info on grob sizes of a ggplot2 object or derived gtable.

Usage

gg_GetPlotSizeInfo(p, unit = "in", keepAll = FALSE, verbose = 0)

Arguments

p
  • ggplot or gtable object

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

keepAll
  • flag (T/F) to keep all grobs (including grobs with physical size 0)

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

Details

This function identifies scales of components in a ggplot2 object. The row/column sizes (and sums) may involve null units reflecting expandable grobs.

Value

invisibly returns a list with elements lyt - vector with plot width and height tbl_rows - table with row sizes sum_rows - table with summed height of rows tbl_cols - table with column sizes sum_cols - table with summed width of columns

Author(s)

William Stockhausen (william.stockhausen@noaa.gov)


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