Skip to contents

This is a function to save standardized images for Brookings publications. For more functionality like custom widths and heights, use ggsave() directly.

Usage

brookings_save(
  filename,
  size = "medium",
  dpi = 300,
  height = NULL,
  plot = ggplot2::last_plot(),
  ...
)

Arguments

filename

File name to create on disk.

size

Size of plot. Must be one of "small" (3.25 x 2 inches), "medium" (6.5 x 4 inches), or "large" (9 x 6.5 inches).

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

height

Adjust height manually

plot

Plot to save, defaults to last plot displayed.

...

Pass additional arguments to ggplot2::ggsave()

Examples


if (FALSE) {
library(tidyverse)
library(ggbrookings)

theme_set(theme_brookings())

cars %>%
  ggplot(aes(speed, dist)) +
  geom_point()

brookings_save("test.png")
}