Learn R Programming

cowplot (version 0.9.2)

plot_to_gtable: Convert plot or other graphics object into a gtable

Description

This function does it's best attempt to take whatever you provide it and turn it into a gtable. It is primarily meant to convert ggplot plots into gtables, but it will also take any grid object (grob), a recorded R base plot, or a function that generates an R base plot.

Usage

plot_to_gtable(plot)

Arguments

plot

The plot or other graphics object to convert into a gtable. Here, plot can be an object of the following classes: ggplot, recordedplot, grob, or gtable. Alternatively, plot can be a function creating a plot when called (see examples for plot_grid()).