我的矩阵具有相同的rownames和colnames:Matrix
然后我使用heatmap.2对称地绘制它:
heatmap.2(matrix, Rowv=T, scale='none', dendrogram="row", symm =T, col = brewer.pal(9,"Reds"))
但我得到的图像如下:
根本不对称。有人可以给我一个建议吗?
谢谢,
sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RColorBrewer_1.1-2 gplots_3.0.1
loaded via a namespace (and not attached):
[1] htmltools_0.3.5 tools_3.3.1 yaml_2.1.13 Rcpp_0.12.5 KernSmooth_2.23-15
[6] rmarkdown_0.9.6 gdata_2.17.0 knitr_1.13 caTools_1.17.1 digest_0.6.9
[11] bitops_1.0-6 gtools_3.5.0
答案 0 :(得分:0)
此代码解决了我的问题:
heatmap.2(m_up, Rowv=F, Colv="Rowv", scale='none', symm =T, col = brewer.pal(9,"Reds"))