[R] deldir package - voronoi

zubin binabina at bellsouth.net
Sun Aug 12 03:22:28 CEST 2007


Hello! 

I am using the deldir package to visualize my data, pretty neat.  
However, i need to fill the colors using polycol =, fill with colors 
like a heatmap - more of a gradient fill.   The only colors i get are 
very blocky - how do i assign the correct colors for a gradient, even a 
grayscale?  i tried the chart of R colors, using 200 numbers for 
grayscale but not getting them.  The polycol = colors the cells in the 
tesselation with the value a specific vector for color. 

Code below:


library(deldir)
set.seed(1)

#generate data
y <- runif(20)
x <- runif(20)
z <- rep((2:4),2)

#run voronoi from deldir package
ddd <- deldir(x,y)
ttt <- tile.list(ddd)
plot.deldir(ddd,wlines="tess")

#play with colors
plot(ttt,polycol=z,close=TRUE)



More information about the R-help mailing list