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",
  s = 123
)

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. Must have 12 colours.

bg_col

Background colour. Default "white".

s

Seed value. Default 123.

Value

A ggplot object