0

我正在使用以下代码创建热图:

    pheatmap(tissuedata3,
    color = colorRampPalette(rev(c("#D73027", "#FC8D59", "#FEE090", "#FFFFBF", "#E0F3F8", "#91BFDB", "#4575B4")))(100),
    cellwidth = 20, cellheight = 2.8,
    border=TRUE,
    treeheight_row=0,
    treeheight_column=0,
    kmeans_k = NA,
    show_rownames = T, show_colnames = T,
    fontsize=2,
    scale="none",
    clustering_method = "complete",
    cluster_rows = FALSE, cluster_cols = TRUE,
    clustering_distance_rows = "euclidean", 
    clustering_distance_cols = "euclidean",
    legend=TRUE,
    )

但是,生成的热图不包含任何边界。有谁知道如何为单元格和整个热图添加边框?

4

1 回答 1

0

我认为正确的参数是border_color其默认值是“grey60”,所以我怀疑(结果不正确)你从你的参数“border”中获得了部分名称匹配,其值变成colors()[1]了 [1]“white”。

尝试:

library(pheatmap)
pheatmap(tissuedata3,
color = colorRampPalette(rev(c("#D73027", "#FC8D59", "#FEE090", "#FFFFBF", "#E0F3F8", "#91BFDB", "#4575B4")))(100),
cellwidth = 20, cellheight = 3,   # changed to 3
border_color="blue",
treeheight_row=0,
treeheight_column=0,
kmeans_k = NA,
show_rownames = T, show_colnames = T,
fontsize=2,
scale="none",
clustering_method = "complete",
cluster_rows = FALSE, cluster_cols = TRUE,
clustering_distance_rows = "euclidean", 
clustering_distance_cols = "euclidean",
legend=TRUE
)
于 2013-08-12T21:08:08.253 回答