Learn R Programming

TaoTeProgramming (version 1.0)

butterflies: Draw butterflies

Description

Draw one butterfly, or multiple butterflies.

Usage

butterflies(num = c(100, 10), scale = c(0.03, 0.1), color = grep("^gray", colors(), value = TRUE), seed = NULL) butterfly(loc, color, scale = 0.1, rand = 0.1)

Arguments

num
a vector giving the number of butterflies to draw on each scale.
scale
the scales at which to draw butterflies.
color
colors of the butterflies.
seed
an integer giving the argument for set.seed.
loc
length two vector giving the location of a single butterfly.
rand
control for how spreadout the wings can be.

Value

nothing useful.

Side effects

create a plot on the current graphics device, and modify the random seed.

References

http://www.burns-stat.com/documents/books/tao-te-programming/

See Also

canvas, set.seed.

Examples

Run this code
# a specific picture
butterflies(color=colors(), seed=7)
# different each time
butterflies(color=colors())

Run the code above in your browser using DataLab