The seaborn clustermap seems to be a figure-level plot which creates its own figure and axes internally.
I would like to use a cluster as a subplot, to be able to add extra plots on the same figure (for instance, a boxplot at the top of the heatmap).
How can I achieve this ?
Thank you
Example for a clustermap:
import numpy as np
import pandas as pd
import seaborn as sns
nb_features = 20
tmp = [v for v in zip(np.repeat(['A', 'B'], 5),
np.hstack([range(5), range(5)]))]
index = pd.MultiIndex.from_tuples(tmp)
df = pd.DataFrame(np.vstack([np.random.rand(5, nb_features) + 1,
np.random.rand(5, nb_features) - 1]), index=index).T
# Returns a seaborn.matrix.ClusterGrid
cax = sns.clustermap(df)