嗨我使用"heatmap.plus"在R中创建了一个热图,它显示在链接中
http://i.stack.imgur.com/hizBf.jpg
但我需要热图看起来像下面链接中显示的热图,它是从其他GUI软件创建的
http://i.stack.imgur.com/Y8Faj.png
如何在R中的每个热图元素中添加黑色边框
Rom*_*rik 17
如果您按照Learn R博客的教程并将此段落中的颜色更改为黑色,您将获得:
(p <- ggplot(nba.m, aes(variable, Name)) +
geom_tile(aes(fill = rescale), colour = "black") +
scale_fill_gradient(low = "white",high = "steelblue"))
Run Code Online (Sandbox Code Playgroud)

尝试这个:
library(plotrix)
#Build a 40 Row by 40 Column Matrix
n <- 40
mat <- matrix(rnorm(n*n), nrow = n)
#Plot it
color2D.matplot(mat, cellcolors = color.scale(mat, c(0,0.5,1), c(1,0.5,0), 0))
Run Code Online (Sandbox Code Playgroud)