Description Usage Arguments Details Examples
Creates plots using some default settings
1 2 3 4 |
x |
a plot object or list of plots |
file |
file name for plot. Uses name of object p as default. |
dir |
directory of where to save plot. Defaults to current working directory. |
width |
width of plot in inches |
height |
height of plot in inches |
format |
can be "pdf", "png", or "all" |
font |
name of font family to embed into file |
onefile |
print to a single pdf device or multiple |
res |
png pixel resolution |
fun |
function to use before dev.off() is called. Can print other stuff to output. |
... |
args passed to fun |
Automatically open and closes the graphics device after use.
1 2 3 4 5 6 7 8 | my_plots <- list(hist(rnorm(100)), hist(rpois(100, 10)))
save_plot(my_plots, dir = "~/../Desktop", format = "all")
# embed font (extrafont package)
library(extrafont)
library(ggplot2)
custom_font_plot <- ex_plot()+theme_mejr(base_family = 'Times')
save_plot(custom_font_plot, dir = "~/../Desktop", format = "pdf", font = 'Times')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.