Skip to content

Commit 16e69f6

Browse files
committed
ggplotGrob function
1 parent 4136c2f commit 16e69f6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export(ggpcp)
7171
export(ggplot_build)
7272
export(ggplot_gtable)
7373
export(ggplot)
74+
export(ggplotGrob)
7475
export(ggsave)
7576
export(ggstructure)
7677
export(guide_colorbar)

R/plot-render.r

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,12 @@ print.ggplot <- function(x, newpage = is.null(vp), vp = NULL, ...) {
175175
invisible(data)
176176
}
177177

178+
#' Generate a ggplot2 plot grob.
179+
#'
180+
#' @param x ggplot2 object
181+
#' @keywords internal
182+
#' @export
183+
ggplotGrob <- function(x) {
184+
gtable_gTree(ggplot_gtable(ggplot_build(x)))
185+
}
186+

0 commit comments

Comments
 (0)