Align 2 heatmaps vertically by columns with one having image annotations on side #76
-
Hi,
-Context: My question is about when we plot 2 heatmaps, using cmlist , it align my 2 heatmap columns very well together when I do not add annot_img on side.
QUESTION: When we plot 2 heatmaps together with image annotations on side of one of them, is there a way to make columns of 2 heatmaps still aligned together while also show annotations images on side for one of them ? ================================================================ plt.figure(figsize=(30, 8)) def row_annotation_left(df_img): img Logosrow_ha_l = pch.HeatmapAnnotation( cm2 = pch.ClusterMapPlotter( cm = pch.ClusterMapPlotter( cmlist = [cm2, cm] =============================================== another image is 2 heatmaps with image annotations Logos on side but columns are not aligned together. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
What if you define row_ha_l and row_ha_2, pass them to cm1 and cm2, and try again? |
Beta Was this translation helpful? Give feedback.
-
I see. Then, I need to change the layout of the composited heatmap and align it with ax_heatmap instead of ax. |
Beta Was this translation helpful? Give feedback.
-
I tried to add a white "pad" beside the heatmap that do not have Logos beside and it is a good work around solution! |
Beta Was this translation helpful? Give feedback.
-
It's great. What do you mean by "white pad"? Can you share your code? |
Beta Was this translation helpful? Give feedback.
Your suggestion make sense! I was actually thinking of doing sometime like you suggest, creating some "empty" annotation same size as the other to use same space.
I understand it is not an easy request.
But not sure how complicated it is to code. If I come up with more ideas I will definitely let you know.
Many thanks for your good answers and if you have a chance, also to try to implement something about it, I am very looking forward to it.