Skip to contents

This function generates a generative art ggplot object featuring multiple coloured rectangles.

Usage

rectangles(
  n = 100,
  max_height = 7,
  max_width = 5,
  size = 2,
  main_col = "lightgrey",
  col_palette = rcartocolor::carto_pal(n = 12, "Bold"),
  bg_col = "white",
  weight = 0.25,
  s = 1234
)

Arguments

n

Number of rectangles. Default 100.

max_height

Maximum height of rectangle. Default 7.

max_width

Maximum width of rectangle. Default 5.

size

Line width of rectangles. Default 2.

main_col

Colour of non-highlighted rectangles. Default "lightgrey".

col_palette

Vector of colours. Default "Bold" colour palette from rcartocolor.

bg_col

Background colour. Default "white".

weight

Sampling weight. Default 0.25.

s

Seed value. Default 1234.

Value

A ggplot object

Examples

rectangles()