save_plot: Save ggplot to pdf and png file.

View source: R/save_plot.R

save_plotR Documentation

Save ggplot to pdf and png file.

Description

Saving a ggplot into a pdf then converting the pdf into a png file. The filenames will automatically be saved with a pdf and png extension.

Usage

save_plot(
  pdfname,
  plot = last_plot(),
  width = 100,
  height = 100,
  units = "mm",
  density = 300
)

Arguments

pdfname

the pdf filename

plot

the ggplot object or the most recent figure in the plot panel.

width

the width of the saved plot in mm. The default is 100.

height

the height of the saved plot in mm. The default is 100.

units

the units of the plot dimensions. The default is "mm".

density

the density of the png file in pixels. The default is 300.

Examples

## Not run: 
save_plot("filename.pdf", width = 100, height = 100, units = "mm")

## End(Not run)


gnishihara/gnnlab documentation built on April 13, 2025, 5:48 p.m.