Hello,

I am using maptools for plooting geographical data.
The colour of the region indicates some region dependent value (population for example).

I pass the colours of the regions to the plot.Map function by defining the foreground colour:

jet.colors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))
n=100
cols <- jet.colors(n)
Intervalls =  cut(as.numeric(Vector),n, na.rm=TRUE)
fgs <-cols[Intervalls] ## is there some option/possibility here to choose colours differently ?? plot.Map(Shape.map, fg=fgs, ol=NA, bty="n", xlab="", ylab="", xaxt="n", yaxt="n")

My problem is the following: I would like to choose minimal and maximal value of the colour palette, different from the minimal and maximal values of the Vector. For example: Vector=c(2,3,4,5,6), but the maximal colour should correspond to 10 and the minimal to 0.

I know, that maptools is not the most actual solution to plot maps, but I am building on an old code and therefore do not want to change it.

I would very much appreciate any help or hints!!
Katrin

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to