我正在使用ggplot和geom_tile来形成热图。我想在细胞间插入一些模糊的线条。
例如:
我的ggplot geom_tile热图:
library(ggplot2)
library(reshape2)
data("iris")
x = melt(cor(iris[,1:4]))
ggplot(data=x,aes(Var1,Var2,fill=value)) + geom_tile() # No line between the cells我想要的(来自R中的d3heatmap包)
library(d3heatmap)
data("iris")
x = cor(iris[,1:4])
d3heatmap(cor(iris[,1:4]),Rowv = F,Colv = F) #There is a faint line between the cells(抱歉不能发任何照片)谢谢!
发布于 2015-09-19 10:36:09
只需将color = "gray"添加到geom_tile
library(ggplot2)
library(reshape2)
data("iris")
x = melt(cor(iris[,1:4]))
ggplot(data=x,aes(Var1,Var2,fill=value)) +
geom_tile(color = "gray")将给出在瓷砖之间有线条的数字:

您可以使用size使线条更大或更小,并/或使用color = white。
https://stackoverflow.com/questions/32665431
复制相似问题