[R] World Heat/Rainbow Map

Lorenzo Isella lorenzo.isella at gmail.com
Sun Feb 19 17:05:34 CET 2012


Dear All,
I would like to do the following: make a plot of the world and color a few selected states.
Some states have an associated scalar (i.e a simple number) and I would like to paint them using a heat map and show legend for the color map in the plot. One or two states do not have any number associated to them and are simply colored/filled according to a distinctive pattern that I choose. 
To fix the ideas, imagine the following situation in which

(1) the US are striped (or filled with any pattern not in the heat map) and no number is associated to them;
(2) China, France and UK have associated values 54, 32 and 14 and I would like to "paint" them according to a heat map.
(3) The other states can be left blank, or I can pretend that there is a "zero" associated to them.

I made some attempts with map(world), but so far I have been banging my head against the wall.
Any suggestion is appreciated.
Cheers

Lorenzo



More information about the R-help mailing list