Learn R Programming

aRtsy (version 0.2.4)

canvas_segments: Draw Segments

Description

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

Usage

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

Value

A ggplot object containing the artwork.

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.

Author

Koen Derks, koen-derks@hotmail.com

See Also

colorPalette

Examples

Run this code
# \donttest{
set.seed(1)

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

Run the code above in your browser using DataLab