How to create annotated heatmaps in subplots?


Yes, I inspected the list(tuple) fig.layout.annotations, and found out that the annotations for the two lower-left cells are not included in the list.

Hence replace the last line of code, fig.update_layout(annotations=annot1+annot2) by the following ones:

new_annotations = annot1+annot2
for anno in new_annotations:

and so the two heatmaps have annotation for each cell.