title: Extracting clusters from seaborn clustermap
body: <p>I am using the <code>seaborn clustermap</code> to create clusters and visually it works great (this <a href="http://web.stanford.edu/~mwaskom/software/seaborn/examples/structured_heatmap.html">example</a> produces very similar results).</p>
  
  <p>However I am having trouble figuring out how to programmatically extract the clusters.  For instance, in the example link, how could I find out that 1-1 rh, 1-1 lh, 5-1 rh, 5-1 lh make a good cluster?  Visually it's easy.  I am trying to use methods of looking through the data, and dendrograms but I'm having little success</p>
  
  <p><strong>EDIT</strong>  Code from example:</p>
  
  <pre><code>import pandas as pd
  import seaborn as sns
  sns.set(font="monospace")
  
  df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0)
  used_networks = [1, 5, 6, 7, 8, 11, 12, 13, 16, 17]
  used_columns = (df.columns.get_level_values("network")
                            .astype(int)
                            .isin(used_networks))
  df = df.loc[:, used_columns]
  
  network_pal = sns.cubehelix_palette(len(used_networks),
                                      light=.9, dark=.1, reverse=True,
                                      start=1, rot=-2)
  network_lut = dict(zip(map(str, used_networks), network_pal))
  
  networks = df.columns.get_level_values("network")
  network_colors = pd.Series(networks).map(network_lut)
  
  cmap = sns.diverging_palette(h_neg=210, h_pos=350, s=90, l=30, as_cmap=True)
  
  result = sns.clustermap(df.corr(), row_colors=network_colors, method="average",
                 col_colors=network_colors, figsize=(13, 13), cmap=cmap)
  </code></pre>
  
  <p>How can I pull what models are in which clusters out of <code>result</code>?</p>
  
  <p><strong>EDIT2</strong>  The <code>result</code> does carry with it a <code>linkage</code> in with the <code>dendrogram_col</code> which I THINK would work with <a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.cluster.hierarchy.fcluster.html">fcluster</a>.  But the threshold value to select that is confusing me.  I would assume that values in the heatmap that are higher than the threshold would get clustered together?</p>