I have a heatmap and want to create shared labels for multiple columns, i.e. a label for columns 1 and 2 and a label for columns 3 and 4 (or any combination of columns). Is this possible with heatmap.2
?
Asked
Active
Viewed 1,306 times
1 Answers
1
Yep. Pass a vector containing NAs to the labCol
argument to skip the labels that you need. Then just adjust adjCol
to get the desired result. You might have to mess around a bit with these parameters, but it's easily doable. For example:
mat <- matrix(rnorm(40), ncol=4)
labvec <- c("B",NA,"A",NA)
library(gplots)
heatmap.2(mat, trace=c("none"), labCol = labvec, adjCol = c(1,4.5))

Joe
- 8,073
- 1
- 52
- 58