gglogo: Create a graphical object from a logo file

View source: R/logo.R

gglogoR Documentation

Create a graphical object from a logo file

Description

The gglogo() function creates a grob (a grid graphical object) from a logo file. This grob can be combined with a ggplot2 plot object.

Usage

gglogo(
  logo,
  file = logo_file_path(logo),
  x = 0.04,
  y = 0.96,
  just = c("left", "top"),
  ...
)

Arguments

logo

Name of a logo available in gouvdown. The list of available logos can be obtained with list_logos().

file

Path to a png file.

x, y

x and y positions of the logo relative to the border. Since these arguments are passed to grid::rasterGrob(), unit objects are allowed.

just

The justification of the rectangle relative to its (x, y) location. If there are two values, the first value specifies horizontal justification and the second value specifies vertical justification. Possible string values are: "left", "right", "centre", "center", "bottom", and "top". For numeric values, 0 means left alignment and 1 means right alignment.

...

Other arguments passed to grid::rasterGrob().

Details

Fill either logo or file parameter: an error is thrown if both parameters are provided.

Value

An object of class "grob".

Examples

library(grid)

header <- gglogo("marianne", x = 0, y = 1)
vp <- viewport(x = 0.22, y = 0.78, width = 0.2, height = 0.2, just = c("right",
    "bottom"))
pushViewport(vp)
grid.draw(header)

spyrales/gouvdown documentation built on Dec. 3, 2023, 3:25 a.m.