Question

I am creating a heatmap using the following code:

    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,
    )

However, the resulting heatmap does not contain any borders. Does anyone know how to add borders to the cells and the heatmap as a whole?

Was it helpful?

Solution

I think the correct parameter is border_color whose default is "grey60", so I suspected (incorrectly as it turned out) you were getting partial name match from your argument "border" whose value becomes colors()[1] which is [1] "white".

Try:

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
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top