x3p_add_hline: Add horizontal line to the mask of an x3p object

Description Usage Arguments Value Examples

View source: R/add_lines_x3p.R

Description

Add horizontal lines to overlay the surface of an x3p object. Lines are added to a mask. In case no mask exists, one is created.

Usage

1
x3p_add_hline(x3p, yintercept, size = 5, color = "#e6bf98")

Arguments

x3p

x3p object

yintercept

(vector of) numerical values for the position of the lines.

size

width (in pixels) of the line

color

(vector of) character values to describe color of lines

Value

x3p object with added vertical lines in the mask

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
logo <- x3p_read(system.file("csafe-logo.x3p", package = "x3ptools"))
color_logo <- magick::image_read(system.file("csafe-color.png", package = "x3ptools"))
logoplus <- x3p_add_mask(logo, as.raster(color_logo))
# five horizontal lines at equal intervals:
logoplus <- x3p_add_hline(logo, seq(0, 418 * 6.4500e-7, length = 5), size = 3)
x3p_image(logoplus, size = c(741, 419), zoom = 0.5)

## End(Not run)

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