Learn R Programming

cowplot (version 0.5.0)

ggsave: Cowplot reimplementation of ggsave.

Description

This function should behave just like ggsave() from ggplot2, with the main difference being that by default it doesn't use the Dingbats font for pdf output. If you ever have trouble with this function, you can try using ggplot2::ggsave() instead.

Usage

ggsave(filename = NULL, plot = ggplot2::last_plot(),
  device = default_device(filename), path = NULL, scale = 1,
  width = graphics::par("din")[1], height = graphics::par("din")[2],
  units = c("in", "cm", "mm"), dpi = 300, limitsize = TRUE, ...)

Arguments

filename
Filename of plot
plot
Plot to save, defaults to last plot displayed.
device
Device to use, automatically extract from file name extension.
path
Path to save plot to (if you just want to set path and not filename).
scale
Scaling factor.
width
Width (defaults to the width of current plotting window).
height
Height (defaults to the height of current plotting window).
units
Units for width and height when either one is explicitly specified (in, cm, or mm).
dpi
DPI to use for raster graphics.
limitsize
When TRUE (the default), ggsave will not save images larger than 50x50 inches, to prevent the common error of specifying dimensions in pixels.
...
Other arguments to be handed to the plot device.