x3p_add_annotation: Add annotations to an x3p object

Description Usage Arguments Value Examples

View source: R/mask_x3p.R

Description

Annotations in an x3p object are legend entries for each color of a mask.

Usage

1
x3p_add_annotation(x3p, color, annotation)

Arguments

x3p

x3p object

color

name or hex value of color

annotation

character value describing the region

Value

x3p object with the added annotations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
logo <- x3p_read(system.file("csafe-logo.x3p", package="x3ptools"))
color_logo <- png::readPNG(system.file("csafe-color.png", package="x3ptools"))
logoplus <- x3p_add_mask(logo, as.raster(color_logo))
x3p_image(logoplus, multiply=50, size = c(741, 419),zoom = 0.5)
logoplus <- x3p_add_annotation(logoplus, "#FFFFFFFF", "background")
logoplus <- x3p_add_annotation(logoplus, "#818285FF", "text")
logoplus <- x3p_add_annotation(logoplus, "#F6BD47FF", "fingerprint")
logoplus <- x3p_add_annotation(logoplus, "#D2202FFF", "fingerprint")
logoplus <- x3p_add_annotation(logoplus, "#92278FFF", "fingerprint")

x3p_add_legend(logoplus)

## End(Not run)

x3ptools documentation built on Nov. 27, 2021, 1:06 a.m.