This function uses a space colony algorithm to draw Petri dish colonies.
canvas_petri(
colors,
background = "#fafafa",
dish = "black",
attractors = 1000,
iterations = 15,
hole = 0
)
a string or character vector specifying the color(s) used for the artwork.
a character specifying the color used for the background (and the hole).
a character specifying the color used for the Petri dish.
an integer specifying the number of attractors.
a positive integer specifying the number of iterations of the algorithm.
a value between 0 and 0.9 specifying the hole size in proportion to the dish.
A ggplot
object containing the artwork.
colorPalette
# \donttest{
set.seed(2)
# Simple example
canvas_petri(colors = colorPalette("origami"))
# Advanced example
canvas_petri(colors = "white", hole = 0.8, attractors = 5000)
# }