Heatmap with dendrogram not working


I am trying to replicate the sample here…

I get this error…

AttributeError Traceback (most recent call last)
in ()
11 # Add Side Dendrogram Data to Figure
—> 12 figure[‘data’].extend(dendro_side[‘data’])
14 # Create Heatmap

AttributeError: ‘tuple’ object has no attribute ‘extend’

At this point, the figure[‘data’] and the dendro_side[‘data’] are both tuples, not lists, so extend will not work.

I have tried this instead.

figure['data'] = figure['data'] + dendro_side['data']

But then I get another error.

ValueError: The data property of a figure may only be assigned a list or tuple that contains a permutation of a subset of itself

What is the right pattern here?


Ok figured it out. Figure () has methods for adding traces.


Happy to raise a PR if somebody can point out the location of the doco