How to put black borders in heatmap in R

后端 未结 3 1982
清歌不尽
清歌不尽 2021-02-03 12:49

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 heatma

3条回答
  •  执笔经年
    2021-02-03 13:19

    Have you tried using heatmap.2? It has paramaters to do just that.

    require("gplots")
    
    data <- # matrix or data frame for your data.
    
    heatmap.2(data, 
              sepwidth=c(0.05, 0.05),  # width of the borders
              sepcolor='black',        # color of the separation lines
              )
    

    You may need more in the parameters depending on what you want in your graphs. R's help on the heatmap.2 function covers pretty much everything you need: ?heatmap.2

提交回复
热议问题