View source: R/brookings_save.R
brookings_save | R Documentation |
This is a function to save standardized images for Brookings publications. For more functionality like custom widths and heights, use ggsave() directly.
brookings_save(
filename,
size = "medium",
dpi = 300,
height = NULL,
plot = ggplot2::last_plot(),
...
)
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() |
## Not run:
library(tidyverse)
library(ggbrookings)
theme_set(theme_brookings())
cars %>%
ggplot(aes(speed, dist)) +
geom_point()
brookings_save("test.png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.