View source: R/create_fullslide.R
create_fullslide | R Documentation |
Takes a ggplot2 object and formats it to look like a Grattan Powerpoint slide. You will rarely need to call this function directly - use ‘grattan_save()' to save a ggplot2 object as a ’slide'-like image.
create_fullslide(plot = last_plot(), type)
plot |
A ggplot2 plot |
type |
Optional. If specified, must be one of "fullslide", "fullslide_169", "fullslide_44", or "blog". This is used to define the size of the white border around the image. |
An object of class "patchwork".
library(ggplot2) p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + labs(title = "My title", subtitle = "My subtitle", caption = "My caption") + theme_grattan() # Create an image that includes the Grattan logo p_logo <- create_fullslide(p) # Create an image that's ready for the blog p_blog <- create_fullslide(p, "blog")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.