canvas_petri {aRtsy}R Documentation

Draw Petri Dish Colonies

Description

This function uses a space colony algorithm to draw Petri dish colonies.

Usage

canvas_petri(
  colors,
  background = "#fafafa",
  dish = "black",
  attractors = 1000,
  iterations = 15,
  hole = 0
)

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 (and the hole).

dish

a character specifying the color used for the Petri dish.

attractors

an integer specifying the number of attractors.

iterations

a positive integer specifying the number of iterations of the algorithm.

hole

a value between 0 and 0.9 specifying the hole size in proportion to the dish.

Value

A ggplot object containing the artwork.

Author(s)

Koen Derks, koen-derks@hotmail.com

References

https://medium.com/@jason.webb/space-colonization-algorithm-in-javascript-6f683b743dc5

See Also

colorPalette

Examples


set.seed(2)

# Simple example
canvas_petri(colors = colorPalette("origami"))

# Advanced example
canvas_petri(colors = "white", hole = 0.8, attractors = 5000)



[Package aRtsy version 0.2.4 Index]