Learn R Programming

datautils (version 0.1.5)

.plot.deldir.datautils:

Description

overrides the original plot.deldir function, to support background colors when printing the tesselation.

Usage

# S3 method for deldir
plot(x, add = FALSE, wlines = c("both", "triang", "tess"), 
    wpoints = c("both", "real", "dummy", "none"), number = FALSE, 
    cex = 1, nex = 1, col = NULL, lty = NULL, pch = NULL, xlim = NULL, 
    ylim = NULL, xlab = "x", ylab = "y", showrect = FALSE, fill = NULL, ...)

Arguments

x
see documentation of deldir::plot.deldir
add
see documentation of deldir::plot.deldir
wlines
see documentation of deldir::plot.deldir
wpoints
see documentation of deldir::plot.deldir
number
see documentation of deldir::plot.deldir
cex
see documentation of deldir::plot.deldir
nex
see documentation of deldir::plot.deldir
col
see documentation of deldir::plot.deldir
lty
see documentation of deldir::plot.deldir
pch
see documentation of deldir::plot.deldir
xlim
see documentation of deldir::plot.deldir
ylim
see documentation of deldir::plot.deldir
xlab
see documentation of deldir::plot.deldir
ylab
see documentation of deldir::plot.deldir
showrect
see documentation of deldir::plot.deldir
fill
vector of colors (in any valid R color format). Each color in the vector is used for the background of the Voronoi cell of the associated element in x.
...
see documentation of deldir::plot.deldir

Examples

Run this code
xvals <- rnorm(50)
yvals <- rnorm(50)
res <- deldir(xvals, yvals)

rvalues <- runif(50)
gvalues <- runif(50)
bvalues <- runif(50)
plot(res, wlines="tess", fill=rgb(rvalues, gvalues, bvalues))

Run the code above in your browser using DataLab