jokergoo / ComplexHeatmap

Make Complex Heatmaps
https://jokergoo.github.io/ComplexHeatmap-reference/book/
Other
1.31k stars 230 forks source link

nrow of all heatmaps should be the same for horizontal heatmap list? #1048

Open ChinJCheung opened 1 year ago

ChinJCheung commented 1 year ago

I am using the ComplexHeatmap::draw function to draw a precompiled list of Heatmaps This is the error I am getting: Error: nrow of all heatmaps should be the same for horizontal heatmap list.

I the cowplot is not identifying the complexheatmap object and patchwork is also not working, can you provide some examples ?

jokergoo commented 1 year ago

As the error message says, in a "heatmap list", numbers of rows should always be the same, because you need to compare between heatmaps, right?

If you just want to make heatmaps as different panels in a "big" figure, generate each heatmap separately, like:

p1 = grid.grabExpr(draw(ht1))
p2 = grid.grabExpr(draw(ht2))

then with cowplot:

plot_grid(p1, p2, ...)