Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_gtable

Convert plot or other graphics object into a gtable


Description

This function does its 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

as_gtable(plot)

plot_to_gtable(plot)

Arguments

plot

The plot or other graphics object to convert into a gtable. Here, plot can be any object handled by as_grob().

Details

To convert ggplot plots, the function needs to use a null graphics device. This can be set with set_null_device().


cowplot

Streamlined Plot Theme and Plot Annotations for 'ggplot2'

v1.1.1
GPL-2
Authors
Claus O. Wilke [aut, cre] (<https://orcid.org/0000-0002-7470-9261>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.