It looks like my ggplot2 heatmap function gets most traffic on this blog. That’s a bit unfortunate, because it’s the first function I wrote in earnest using ggplot2 and ggplot2 itself has undergone some updates since then, meaning my code is clunky, outdated and, er, broken.
So, with a bit more knowledge of ggplot2 and grid gained over the last few months, I have updated it today, and it is working. I hope it’s useful!
Get the code from github, and run it with
## simulate data library(mvtnorm) sigma=matrix(0,10,10) sigma[1:4,1:4] <- 0.6 sigma[6:10,6:10] <- 0.8 diag(sigma) <- 1 X <- rmvnorm(n=100,mean=rep(0,10),sigma=sigma) ## make plot p <- ggheatmap(X) ## display plot ggheatmap.show(p)
The result should look something like