如何调整heatmap中的列标签

时间:2015-11-17 16:53:16

标签: r heatmap

以下是我对heatmap.3的代码:

heatmap.3(x = as.matrix(res), dist.FUN = dist2, scale = 'row', color.FUN = col_ylgnbu, 
                           cex.main = 2, trace = 'none', srtCol = 45, adjCol = c(1,0.1),
                           main = paste(title), 
                           key = T, cexRow = 2, cexCol = 1)

我使用以下代码获得以下热图:

enter image description here

我的问题是如何调整列标签以使它们不与热图重叠?

谢谢!

1 个答案:

答案 0 :(得分:0)

您可以将 adjCol 设置为居中对齐, offsetCol 可以将标签向下移动:

heatmap.3(x = as.matrix(res), dist.FUN = dist2, scale = 'row', 
    color.FUN = col_ylgnbu, 
    cex.main = 2, trace = 'none', srtCol = 45, 
    adjCol = c(1,0), offsetCol=1
    main = paste(title), 
    key = T, cexRow = 2, cexCol = 1)

此处有更多说明:http://earlglynn.github.io/RNotes/package/gplots/heatmap2.html