0

I have matrix with the same rownames and colnames:Matrix

Then I use heatmap.2 to plot it symmetrically:

heatmap.2(matrix, Rowv=T, scale='none', dendrogram="row", symm =T, col = brewer.pal(9,"Reds"))

But I got the image as below:

enter image description here

It is not symmetrical at all. Can someone give me a suggestion?

Thanks,

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      

1 Answers1

0

This code solves my problem:

heatmap.2(m_up, Rowv=F, Colv="Rowv", scale='none', symm =T, col = brewer.pal(9,"Reds"))