Learn R Programming

ggsketch (version 2.0.0)

sketch_dotplot_grob: Create a sketchy dot-plot grob (stacked circular dots)

Description

Draws stacked roughened dots for a Wilkinson-style dot plot. The dot diameter is taken from dia (an npc-x fraction = the bin width) and converted to device inches at draw time, so every dot is a true circle whatever the panel aspect, and stacks are built upward from baseline by that diameter.

Usage

sketch_dotplot_grob(
  x,
  stackpos,
  dia,
  baseline = 0,
  stackratio = 1,
  roughness = 0.5,
  n_passes = 2L,
  seed = NULL,
  fill_gp = gpar(),
  outline_gp = gpar(),
  name = NULL,
  vp = NULL
)

Value

A SketchDotplotGrob grob subclass.

Arguments

x

Npc [0,1] x of each dot (its bin centre), one per dot.

stackpos

Integer stack position of each dot within its bin (1 = first).

dia

Dot diameter as an npc-x fraction (scalar; the bin width).

baseline

Npc y the stacks grow from. Default 0.

stackratio

Vertical spacing between stacked dots, as a fraction of the diameter. Default 1.

roughness, n_passes, seed

Sketch parameters.

fill_gp

gpar() for the solid dot fill (per-dot col recycled; NA leaves dots unfilled).

outline_gp

gpar() for the roughened dot outline (per-dot col).

name, vp

Passed to grid::gTree().

See Also

Other grob-layer: sketch_arrow_grob(), sketch_band_grob(), sketch_callout_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()