):
i: 行索引
j: 列索引
x: 小格子中心点横坐标
y: 小格子中心点纵坐标
width: 小格子宽度
height: 小格子高度
fill: 小格子填充色
最常见的用法是在热图中添加数字:
small_mat...]
也可以选择只添加大于0的数字:
Heatmap(small_mat, name = "mat", col = col_fun,
cell_fun = function(j, i, x, y...= 10))
})
[image-20220113142151563]
可视化相关性矩阵:
cor_mat = cor(small_mat)
od = hclust(dist(cor_mat))$order...cor_mat = cor_mat[od, od]
nm = rownames(cor_mat)
col_fun = circlize::colorRamp2(c(-1, 0, 1), c("green...(i > j) {
grid.circle(x = x, y = y, r = abs(cor_mat[i, j])/2 * min(unit.c(width, height))