Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Convert seaborn clustermap to plotly interactive figures

I generate a clustermap using seaborn - I find it very convenient for some of these types of plots but I am having problem converting it to plotly

import pandas as pd
import random
import matplotlib.pyplot as plt
import seaborn as sns

df = pd.DataFrame()

df[‘x’] = random.sample(range(1, 100), 25)
df[‘y’] = random.sample(range(1, 100), 25)

L = []
for i in range(25):
L.append(‘longlonglabel’ + str(i))

test

fig, ax = plt.subplots()

df.index = L
cg = sns.clustermap(df)

Iterate over the labels

for text in cg.ax_heatmap.get_yticklabels():
text.set_rotation(‘horizontal’)

plt.show()

I have tried to use the tools

import plotly.tools as tls
cg = sns.clustermap(df)

plotly_fig = tls.mpl_to_plotly( cg )

but I get the error

AttributeError: ‘ClusterGrid’ object has no attribute ‘dpi’

how to convert between these - thanks