Learn R Programming

TaoTeProgramming (version 1.0)

mountscene: Draw mountains, hills and beaches

Description

Draws a variety of scenes depending on some subtle changes.

Usage

mountscene(levels = 5, vlen = 200, tilt = 0.2, df = 7, color = NULL, box = TRUE, seed = NULL) hillscene(num = 100, vlen = 200, tilt = 0.2, df = 7, color = NULL, seed = NULL) mountain(values, color, df = 7)

Arguments

levels
number of levels of objects in the scene.
vlen
the number of random points along a level.
tilt
the slope of the level. This is in fractions of the vertical dimension -- the left side is at tilt below the average level and the right side is tilt above.
df
degrees of freedom of the smoothing of the random points.
color
colors to fill in below each level.
box
logical value: if TRUE, a frame is drawn around the picture.
seed
an integer giving the argument for set.seed.
num
the number of hills.
values
numeric vector that is smoothed.

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
# hills
hillscene(color=grep("green|yellow", colors(), value=TRUE))

# waves
hillscene(tilt=0,
   color=grep("aqua", colors(), value=TRUE))

Run the code above in your browser using DataLab