gta_plot_saver: Save png and eps plots together more easily.

View source: R/gta plot saver.R

gta_plot_saverR Documentation

Save png and eps plots together more easily.

Description

This function saves ggplot objects as png and eps. Optimized for width of A4 paper, but can be changed accordingly.

Usage

gta_plot_saver(
  plot = NULL,
  path = "/",
  name = "plot",
  width = 21,
  height = NULL,
  png = T,
  eps = F,
  pdf = F,
  jpg = F,
  cairo_ps = F,
  aspect.ratio = 21/29.7
)

Arguments

plot

Specify the plot to save.

path

Specify the folder to save the plot into as string. Default: working directory.

name

Input the name of the plot as string. Default: "plot".

width

Takes in a specific plot height. If unspecified, height will be calculated through aspect.ratio.

png

Set png output to FALSE. Default: TRUE.

eps

Set cairo_ps output to TRUE if you want to generate an eps file with transparency levels. Default: FALSE.

aspect.ratio

Define the aspect ratio of the plot as integer. Width = 1, height = 1*aspect.ratio. If height is defined, aspect.ratio does have no effect.

Author(s)

Global Trade Alert

References

www.globaltradealert.org


global-trade-alert/gtalibrary documentation built on April 26, 2024, 12:38 p.m.