View source: R/ggsave_elsevier.R
ggsave_elsevier | R Documentation |
Save a plot using ggplot2::ggsave()
.
Plot size follows instructions of Elsevier journals.
ggsave_elsevier(
filename,
plot,
width = c("one_column", "one_half_column", "full_page"),
height,
...
)
filename |
A character string. File name to create on disk. |
plot |
Plot to save, ggplot or other grid object. |
width |
Plot width. See Details for more information. |
height |
Plot height in "mm". |
... |
Passed to |
Instruction of Elsevier about sizing of artwork.
Image width:
single column: 90 mm (255 pt)
1.5 column: 140 mm (397 pt)
double column (full width): 190 mm (539 pt)
Image height: maximum 240 mm.
An image file containing the saved plot.
ggplot2::ggsave()
library(ggplot2)
fig <- ggplot(mtcars, aes(y = mpg, x = disp)) +
geom_point(aes(colour = factor(cyl)))
## For demo, a temp. file path is created with the file extension .png
png_file <- tempfile(fileext = ".png")
ggsave_elsevier(png_file, plot = fig, width = "full_page", height = 120)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.