SI_ggsave: Save a branded plot

Description Usage Arguments Value Examples

Description

Save a ggplot2 plot as png with an optional Sorenson Impact branding bar.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
si_ggsave(
  filename = "auto",
  dir = "auto",
  plot = ggplot2::last_plot(),
  width = 6,
  height = 4,
  dpi = 300,
  add_logo = TRUE,
  logo_height_ratio = 0.05,
  band_color = si_design$granite
)

Arguments

filename

Filename to create on disk. If "auto", defaults to the title of the last_plot within the plot_directory.

dir

Directory to save file to. Defaults to "auto", which places plots in a "plots" subdir of the script dir.

plot

Plot to save, defaults to last plot displayed.

width

Width in inches (default: 6).

height

Height in inches (default: 4).

dpi

Dots per inch. Defaults to 300. The resolution of the file will be width*DPI by height*DPI.

add_logo

Logical. Add the sorenson impact branding bar? (defaults: TRUE)

logo_height_ratio

Number between 0 and 1, with sensibile values between .01 and .1. The percent of the image height that the bar should be. Default is 0.05.

band_color

The color of the SI Logo band. Defaults to si_design$granite.

Value

A png of the last plot with optional SI logo band.

Examples

1
2
3
4
5
## Not run: 
SI_colorplot() + ggplot2::ggtitle("My Title")
SI_ggsave(add_logo = TRUE)

## End(Not run)

Sorenson-Impact/sorensonimpact documentation built on Nov. 6, 2021, 4:25 a.m.