Learn R Programming

x3ptools (version 0.0.4)

x3p_add_annotation: Add annotations to an x3p object

Description

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

Usage

x3p_add_annotation(x3p, color, annotation)

Value

x3p object with the added annotations

Arguments

x3p

x3p object

color

name or hex value of color

annotation

character value describing the region

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab