Learn R Programming

ggsketch (version 2.0.0)

sketch_spray_grob: Create an airbrush / spray stroke grob

Description

A grid grob that draws its path as a soft cloud of dots instead of a stroked line: it re-roughens the centreline at device resolution, then scatters dots around it with spray_scatter(), for the airbrush / spray-can medium (no hard outline). Coordinates are npc [0,1]; the scatter happens in device inches inside makeContent().

Usage

sketch_spray_grob(
  x,
  y,
  id = NULL,
  spread = 0.05,
  density = 150,
  dot_r = 0.004,
  roughness = 1,
  bowing = 1,
  n_passes = 1L,
  seed = NULL,
  gp = gpar(),
  name = NULL,
  vp = NULL
)

Value

A SketchSprayGrob (a grid grob subclass).

Arguments

x, y

Numeric vectors of npc [0,1] coordinates.

id

Integer vector grouping coordinates into separate strokes (NULL treats all points as one).

spread, density, dot_r

Passed to spray_scatter() (in inches).

roughness, bowing, n_passes, seed

Sketch parameters for the centreline.

gp

A grid::gpar(); its col becomes the dot fill, alpha is honoured.

name, vp

Passed to grid::gTree().

See Also

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