Hi,


I'm trying to get an isarithmic map of votes in France.

I've calculated a vector of n colors depending on the pixel value, n being
the raster number of pixels.

In col, I must specify a palette, but how can I use my color vector?

Here is the line of code for the moment (which doesn't work):
cols <- hsv(ifelse(values(r) > .5, 0, .7), values(r), 1)
plot(r, col=topo.colors(20), axes=FALSE)


Thanks!

Mathieu

--
the entire code:
library(raster)
library(gstat)
x <- g2.pp$x; y <- g2.pp$y
z <- marks(g2.pp)
df <- as.data.frame(cbind(x, y, z))
r <- raster(extent(g2))
res(r) <- 500
mg.pchol <- gstat(id="z", formula=z~1, locations=~x+y, data=df, nmax=9,
set=list(idp=.5))
r <- interpolate(r, mg)
cols <- hsv(ifelse(values(r) > .5, 0, .7), values(r), 1)
plot(r, col=topo.colors(20), axes=FALSE)

	[[alternative HTML version deleted]]

