ggfigsave | R Documentation |
Outputs a ggplot object as a pdf with standard scientific journal settings, and saves and rds object
ggfigsave( ggdata, name = waiver(), path = waiver(), dpi = 600, width = 6.5, height = waiver(), aspect_ratio = 1, units = c("in", "cm", "mm", "px"), format = c("pdf", "png", "rds"), open = FALSE, overwrite = FALSE )
ggdata |
ggplot2 object |
name |
Filename (optional, defaults to name of the input ggplot object) |
path |
Path of the directory to save plot to: |
dpi |
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types. |
width |
Plot size in |
height |
Plot size in |
aspect_ratio |
Ratio of width to height. Default = 1. |
units |
Plot size in |
format |
Output file format, any of "rds", "pdf", "eps", "ps", "tex", "jpeg", "tiff", "png", "bmp", "svg". |
open |
Open the image file after creation. Default = TRUE. |
overwrite |
Whether to overwrite an existing file. Default = FALSE, which appends a numeric index to the filename. |
Original ggplot object, invisibly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.