How to put black borders in heatmap in R

Jana picture Jana · Feb 17, 2011 · Viewed 18.8k times · Source

Hi I created a heatmap in R using "heatmap.plus" which is shown in the link

http://i.stack.imgur.com/hizBf.jpg

but I need the heat map to look like the heatmap shown in below link which was created from some other GUI software

http://i.stack.imgur.com/Y8Faj.png

How can I put black borders in every heatmap element in R

Answer

Roman Luštrik picture Roman Luštrik · Feb 18, 2011

If you follow the tutorial from Learn R blog and change the color in this paragraph to black, you will get:

(p <- ggplot(nba.m, aes(variable, Name)) +
    geom_tile(aes(fill = rescale), colour = "black") +
    scale_fill_gradient(low = "white",high = "steelblue"))

enter image description here