Skip to contents

Compute or draw rough polygons

Usage

rough_polygons(x, y = NULL, hand = NULL)

draw_rough_polygons(
  x,
  y = NULL,
  hand = NULL,
  col = NA,
  border = graphics::par("fg"),
  fill_pattern = NULL,
  ...
)

Arguments

x, y

Polygon coordinates.

hand

Hand-drawn geometry settings created with hand().

col

Fill colour. When visible and fill_pattern is NULL, a solid fill is drawn.

border

Border colour.

fill_pattern

Optional fill pattern created with hatch(), crosshatch(), zigzag(), or jumble().

...

Graphics parameters passed to graphics::lines().

Value

A list with x and y components containing a roughened closed outline suitable for plotting with graphics::lines().

Examples

plot(1:10, 1:10, type = "n")
draw_rough_polygons(c(2, 5, 8, 3), c(2, 7, 5, 1),
                    hand = human_hand(),
                    col = "grey90",
                    fill_pattern = zigzag())