A grid grob that draws its path as a tapered / pressure-varying hand-drawn
stroke. Unlike sketch_path_grob() (constant-lwd polylines), the line is
built from stroke_ribbon() polygons, so it can taper to a point, swell with
pressure, or vary like a broad calligraphic nib. Coordinates are npc [0,1];
roughening and offsetting happen in device inches inside makeContent().
Usage
sketch_stroke_grob(
x,
y,
id = NULL,
width = 0.03,
roughness = 1,
bowing = 1,
n_passes = 2L,
seed = NULL,
taper = "none",
taper_frac = 0,
pressure = NULL,
nib_angle = NULL,
jitter_w = 0,
cap = "round",
gp = gpar(),
name = NULL,
vp = NULL
)Arguments
- x, y
Numeric vectors of npc [0,1] coordinates.
- id
Integer vector grouping coordinates into separate strokes (same semantics as
sketch_path_grob()).NULLtreats all points as one stroke.- width
Full stroke width in inches. Default
0.03.- roughness, bowing, n_passes, seed
Sketch parameters for the centreline.
- taper, taper_frac, pressure, nib_angle, jitter_w, cap
Passed to
stroke_ribbon().- gp
A
grid::gpar(); itscolbecomes the ribbon fill (the ribbon is painted, not stroked),alphais honoured.- name, vp
Passed to
grid::gTree().
