This function draws line segments on a canvas. The length and direction of the line segments is determined randomly.

canvas_segments(
  colors,
  background = "#fafafa",
  n = 250,
  p = 0.5,
  H = 0.1,
  size = 0.2
)

Arguments

colors

a string or character vector specifying the color(s) used for the artwork.

background

a character specifying the color used for the background.

n

a positive integer specifying the number of line segments to draw.

p

a value specifying the probability of drawing a vertical line segment.

H

a positive value specifying the scaling factor for the line segments.

size

a positive value specifying the size of the line segments.

Value

A ggplot object containing the artwork.

See also

colorPalette

Author

Koen Derks, koen-derks@hotmail.com

Examples

# \donttest{
set.seed(1)

# Simple example
canvas_segments(colors = colorPalette("dark1"))

# }