jokergoo / ComplexHeatmap

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

Padding not working with heatmap list #1173

Closed bk1n closed 7 months ago

bk1n commented 7 months ago

I am trying to plot a list of Heatmap as follows:

hm_list = Heatmap(mat1, left_anno, row_split) + Heatmap(mat2) + ... + Heatmap(matx)

When I run

draw(hm_list)

My row titles (generated by row_split) on the left and my legends on the right are cut off.

Left hand side: 1

Right hand side: 2

I tried to adjust the padding as follows:

draw(hm_list, padding = unit(c(.1, 2, .1, 2), 'in'))

But this does not change anything. In fact, changing right or left bottom padding to any unit value does not change anything. Any idea why this might be? What can I do to fix?

Thanks!

bk1n commented 7 months ago

I think this was due to widths being specified manually in all the plots, then not having enough space in the plot when calling png(..., width = x, height = y).

Increasing width in the png() call fixed this issue.