Open nolanjj opened 1 year ago
I guess you only want the dendrogram and the top annotation? Then you can do it in two steps:
set.seed(123)
m = matrix(rnorm(200), 20, 10)
hc = hclust(dist(t(m)))
m_zero = matrix(nrow = 0, ncol = 10)
Then creating the top annotation. Note here I move the annotation names to the left so that they will not overlap with the legend.
ha = HeatmapAnnotation(foo = 1:10, bar = anno_points(runif(10)),
annotation_name_side = "left")
And finally put everything together:
Heatmap(m_zero, top_annotation = ha, cluster_columns = hc)
Heatmap(m_zero, top_annotation = ha, cluster_columns = hc)
Thank you! ComplexHeatmap is too powerful!
help! I want to remove the main body of heatmap.Keep the cluster tree and comments at the top.What should I do