label: Add a label

Description Usage Arguments Value Examples

View source: R/label.R

Description

This is just a wrapper function for magick::image_annotate that allows more flexibility in color input.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
label(
  stimuli,
  text = TRUE,
  gravity = "north",
  location = "+0+10",
  degrees = 0,
  size = NULL,
  font = "sans",
  style = "normal",
  weight = 400,
  kerning = 0,
  decoration = NULL,
  color = "black",
  strokecolor = NULL,
  boxcolor = NULL
)

Arguments

stimuli

list of class stimlist

text

a vector of the label text(s) or TRUE to use stimlist names

gravity

string with gravity value from magick::gravity_types.

location

geometry string with location relative to gravity

degrees

rotates text around center point

size

font size in pixels (if NULL, scales to 5% image height)

font

string with font family such as "sans", "mono", "serif", "Times", "Helvetica", "Trebuchet", "Georgia", "Palatino" or "Comic Sans".

style

value of style_types for example "italic"

weight

thickness of the font, 400 is normal and 700 is bold.

kerning

increases or decreases whitespace between letters

decoration

value of decoration_types for example "underline"

color

a vector of the label colour(s)

strokecolor

adds a stroke (border around the text)

boxcolor

adds a background color

Value

stimlist with labelled images

Examples

1
2
3
demo_stim("test") %>%
  label(c("CHINWE", "GEORGE"), color = "red") %>%
  plot()

facelab/webmorph documentation built on April 11, 2021, 6:34 a.m.