create_blog.RdTakes a ggplot2 object and formats it as a 23.16cm x 23.16cm square image suitable for social media. The layout consists of a grey title bar containing the title and logo, a subtitle area, a chart panel, and a caption area.
A ggplot2 plot.
Either "slide" (default) or "normal". "slide" uses DM Serif Display for the title and Avenir Next for body text (if available). "normal" uses the default sans-serif font.
Default is FALSE. If TRUE, the check on a long title won't be performed. This is useful if using ggtext syntax within titles.
An object of class "patchwork" sized for a 23.16cm x 23.16cm blog image.
You will rarely need to call this function directly - use `grattan_save()` with `type = "blog"` (or `grattan_save_web()`) to save a ggplot2 object as a blog image.
library(ggplot2)
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
labs(title = "My title",
subtitle = "My subtitle",
caption = "My caption") +
theme_grattan()
p_blog <- create_blog(p, font = "normal")