Quickly save a ggplot to a file
Usage
s_ggsave(
plot = ggplot2::last_plot(),
filename,
path = "wd",
width = 7,
height = 5,
units = "in",
dpi = 300,
bg = "white"
)
Arguments
- plot
A ggplot object
- filename
A character string of the file name
- path
A character string of the file path. By default, it is the working directory.
- width, height
Plot size in units expressed by the
units
argument. If not supplied, uses the size of the current graphics device.- units
One of the following units in which the
width
andheight
arguments are expressed:"in"
,"cm"
,"mm"
or"px"
.- dpi
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.
- bg
Background colour. If
NULL
, uses theplot.background
fill value from the plot theme.