Is it possible to assign colours to leaf labels of dendrogram plots from Scipy? I can't figure it out from the documentation. Here's what I've tried so far:
from scipy.spatial.distance import pdist, squareform
from scipy.cluster.hierarchy import linkage, dendrogram
distanceMatrix = pdist(subj1.ix[:,:3])
dendrogram(linkage(distanceMatrix, method='complete'),
color_threshold=0.3,
leaf_label_func=lambda x: subj1['activity'][x],
leaf_font_size=12)
Thanks.