create_fullslide: Assemble a chart featuring the Grattan logo and orange line

View source: R/create_fullslide.R

create_fullslideR Documentation

Assemble a chart featuring the Grattan logo and orange line

Description

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.

Usage

create_fullslide(plot = last_plot(), type)

Arguments

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.

Value

An object of class "patchwork".

Examples


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")


grattan/grattantheme documentation built on June 28, 2023, 1:50 p.m.