View source: R/gg_GetPlotDims.R
gg_GetPlotDims | R Documentation |
Function to get dimensions of a ggplot2 object or derived gtable.
gg_GetPlotDims(
p,
unit = "in",
null = 3,
null_x = NULL,
null_y = NULL,
returnAll = FALSE,
verbose = 0
)
p |
|
unit |
|
null |
|
null_x |
|
null_y |
|
returnAll |
|
verbose |
|
This function converts "null" (relative) scales in a ggplot2 object (or derived gtable) to absolute scales.
If either null_x or null_y is NULL, then the value of null
is used for both. If
both null_x and null_y are not NULL, these values are used for nulls along the corresponding
axes.
if returnAll is FALSE, returns a vector with plot width and height. Otherwise, it invisibly returns a list with elements dims - vector with plot width and height lyt - layout table tbl_rows - row dimensions tbl_cols - column dimensions tbl_matp -tibble with intermediate information tbl_matpp - tibble with intermediate information
This does not work (yet) for composite figures consisting of multiple ggplot2 objects.
William Stockhausen (william.stockhausen@noaa.gov)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.