Learn R Programming

ggsketch (version 2.0.0)

sketch_band_grob: Create a sketchy filled-band grob (hole-aware region)

Description

Draws one filled region made of several rings (outer pieces and holes) - the building block for filled contour / 2-D density bands. The whole region is filled with a single hole-aware scan-line (so holes stay empty), and every ring is stroked with a roughened outline. A "solid" fill paints the rings with an even-odd rule.

Usage

sketch_band_grob(
  rings,
  roughness = 0.7,
  bowing = 0.5,
  n_passes = 2L,
  seed = NULL,
  fill_style = "solid",
  hachure_angle = 45,
  hachure_gap = 0.05,
  fill_weight = 0.5,
  fill_col = NA,
  outline_gp = gpar(),
  name = NULL,
  vp = NULL
)

Value

A SketchBandGrob grob subclass.

Arguments

rings

A list of rings, each a list with npc [0,1] x and y vertex vectors. The even-odd arrangement of outer pieces and holes is honoured.

roughness, bowing, n_passes, seed

Sketch parameters for the outlines.

fill_style

"solid" (default), "hachure", "cross_hatch", or "watercolor" (hole-aware translucent washes).

hachure_angle, hachure_gap, fill_weight

Fill parameters (hachure_gap is an npc fraction).

fill_col

Fill colour (NA leaves the region empty).

outline_gp

gpar() for the roughened ring outlines.

name, vp

Passed to grid::gTree().

See Also

Other grob-layer: sketch_arrow_grob(), sketch_callout_grob(), sketch_dotplot_grob(), sketch_ellipse_grob(), sketch_engrave_grob(), sketch_path_grob(), sketch_polygon_grob(), sketch_repel_grob(), sketch_spray_grob(), sketch_stroke_grob(), sketch_wedge_grob()