opmi_ggsave | R Documentation |
The default ggsave
options do not work well with the
showtext
package, which is used to get the correct fonts. This changes
the resolution settings.
opmi_ggsave(
filename,
plot = ggplot2::last_plot(),
device = NULL,
path = NULL,
scale = 1,
width = NA,
height = NA,
units = c("in", "cm", "mm", "px"),
dpi = 96,
limitsize = TRUE,
bg = NULL,
...
)
filename |
File name to create on disk. |
plot |
Plot to save, defaults to last plot displayed. |
device |
Device to use. Can either be a device function (e.g. png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only). |
path |
Path of the directory to save plot to: |
scale |
Multiplicative scaling factor. |
width, height, units |
Plot size in |
dpi |
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types. |
limitsize |
When |
bg |
Background colour. If |
... |
Arguments passed to |
Saves a plot to a file.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.