powered by
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 ggplot object containing the artwork.
ggplot
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.
Koen Derks, koen-derks@hotmail.com
https://medium.com/@jason.webb/space-colonization-algorithm-in-javascript-6f683b743dc5
colorPalette
# \donttest{ set.seed(2) # Simple example canvas_petri(colors = colorPalette("origami")) # Advanced example canvas_petri(colors = "white", hole = 0.8, attractors = 5000) # }
Run the code above in your browser using DataLab