x3p_add_grid: Add a grid of helper lines to the mask of an x3p object

View source: R/add_lines_x3p.R

x3p_add_gridR Documentation

Add a grid of helper lines to the mask of an x3p object

Description

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

Usage

x3p_add_grid(
  x3p,
  spaces,
  size = c(1, 3, 5),
  color = c("grey50", "black", "darkred")
)

Arguments

x3p

x3p object

spaces

space between grid lines, doubled for x

size

width (in pixels) of the lines

color

(vector of) character values to describe color of lines

Value

x3p object with added vertical lines in the mask

Examples

## Not run: 
logo <- x3p_read(system.file("csafe-logo.x3p", package = "x3ptools"))
# ten vertical lines across:
logoplus <- x3p_add_grid(logo,
  spaces = 50e-6, size = c(1, 3, 5),
  color = c("grey50", "black", "darkred")
)
x3p_image(logoplus, size = c(741, 419), zoom = 0.5)

## End(Not run)

x3ptools documentation built on May 29, 2024, 10:33 a.m.