finaliseGraph: finaliseGraph

Description Usage Arguments Value

View source: R/finaliseGraph.R

Description

Function for finalising a plot - resize, add logo and caption, then save.

Running this function will save the given or last plot with the correct guidelines for publication. It will left align title, subtitle and caption, add the given logo at the bottom right and save it to a specified file name and location.

Basis of this is the BBCplot function

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
finaliseGraph(
  plot = last_plot(),
  caption = "Source: CA&I  ©",
  filename,
  filepath = getwd(),
  size = "full",
  width = 640,
  height = 450,
  unit = "px",
  logo_path,
  overwrite = TRUE
)

Arguments

plot

The name of the plot

caption

The text for the caption. "None" for no caption. "Existing" for the existing caption

filename

Desired file name

filepath

Path to the directory

size

Specify the size - "full", "half", "long", or "manual", which references height and width

width

Width in pixels defaults to 640

height

Height in pixels defaults to 450

unit

Default is pixels (px), but accepts cm

logo_path

File path for the logo image - PNG format

overwrite

Whether to overwrite existing files, without asking

Value

An updated ggplot object invisibly


CommoditiesAI/graphHelpers documentation built on Jan. 1, 2022, 12:12 a.m.