I created a very simple heatmap chart with Seaborn displaying a similarity square matrix. Here is the one line of code I used:
sns.heatmap(sim_mat, linewidth
When both dendrograms are used one can also add a new hidden axis and draw the legend.
ax= f.add_axes((0,0,0,0))
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
for label in node_labels.unique():
ax.bar(0, 0, color=node_lut[label], label=label, linewidth=0)
l2 = g.ax_row_dendrogram.legend(title='Node', loc="center", ncol=2, bbox_to_anchor=(0.8, 0.8), bbox_transform=f.transFigure)