Skip to contents

Save ggplot with optional legend removal and sensible defaults

Usage

ggsaveDK(filename, plot, legend = TRUE, width = 7, height = 7, dpi = 300, ...)

Arguments

filename

File path to save to.

plot

A ggplot object.

legend

Logical. If FALSE, removes the legend before saving.

width

Width in inches. Default is 7.

height

Height in inches. Default is 7.

dpi

Dots per inch. Default is 300.

...

Additional arguments passed to ggsave().

Value

Invisibly returns the saved plot.