ggsave_elsevier: Save a plot - Elsevier figure size

View source: R/ggsave_elsevier.R

ggsave_elsevierR Documentation

Save a plot - Elsevier figure size

Description

Save a plot using ggplot2::ggsave(). Plot size follows instructions of Elsevier journals.

Usage

ggsave_elsevier(
  filename,
  plot,
  width = c("one_column", "one_half_column", "full_page"),
  height,
  ...
)

Arguments

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 ggplot2::ggsave()

Details

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.

Value

An image file containing the saved plot.

See Also

ggplot2::ggsave()

Examples


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)

lehuynh documentation built on June 22, 2024, 9:35 a.m.