<p dir="auto">With some dataframes we encounter strange behaviours of the clustermap, where a dendrogram on one axis does not align with the heat map cells as it has too few branches.</p>
<p dir="auto">An example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt

df = pd.DataFrame({'A': {0: 0.5, 1: 0.0, 2: 1.0, 3: 0.0, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.0, 10: 0.0, 11: 0.5, 12: 0.0, 13: 0.5, 14: 0.0, 15: 0.0, 16: 0.0, 17: 0.0}, 'B': {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 1.0, 5: 1.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.5, 10: 0.0, 11: 1.0, 12: 0.0, 13: 0.0, 14: 0.0, 15: 0.0, 16: 0.0, 17: 0.0}, 'C': {0: 1.0, 1: 0.0, 2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0, 6: 1.0, 7: 0.5, 8: 0.5, 9: 0.0, 10: 1.0, 11: 0.0, 12: 0.0, 13: 0.0, 14: 0.0, 15: 0.5, 16: 0.5, 17: 0.0}, 'D': {0: 0.0,1: 0.5, 2: 1.0, 3: 0.5, 4: 0.5, 5: 0.5, 6: 0.0, 7: 0.5, 8: 0.0, 9: 0.0, 10: 1.0, 11: 1.0, 12: 1.0, 13: 1.0, 14: 0.5, 15: 0.0, 16: 0.0, 17: 1.0}})

sns.clustermap(df, cmap='Greens', col_cluster = False, linewidth=0.5, linecolor='red', tree_kws={'colors':'blue'})
plt.show()
"><pre class="notranslate"><code class="notranslate">import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt

df = pd.DataFrame({'A': {0: 0.5, 1: 0.0, 2: 1.0, 3: 0.0, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.0, 10: 0.0, 11: 0.5, 12: 0.0, 13: 0.5, 14: 0.0, 15: 0.0, 16: 0.0, 17: 0.0}, 'B': {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 1.0, 5: 1.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.5, 10: 0.0, 11: 1.0, 12: 0.0, 13: 0.0, 14: 0.0, 15: 0.0, 16: 0.0, 17: 0.0}, 'C': {0: 1.0, 1: 0.0, 2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0, 6: 1.0, 7: 0.5, 8: 0.5, 9: 0.0, 10: 1.0, 11: 0.0, 12: 0.0, 13: 0.0, 14: 0.0, 15: 0.5, 16: 0.5, 17: 0.0}, 'D': {0: 0.0,1: 0.5, 2: 1.0, 3: 0.5, 4: 0.5, 5: 0.5, 6: 0.0, 7: 0.5, 8: 0.0, 9: 0.0, 10: 1.0, 11: 1.0, 12: 1.0, 13: 1.0, 14: 0.5, 15: 0.0, 16: 0.0, 17: 1.0}})

sns.clustermap(df, cmap='Greens', col_cluster = False, linewidth=0.5, linecolor='red', tree_kws={'colors':'blue'})
plt.show()

</code></pre></div>
<p dir="auto">In the resulting figure one can see that the dendogram leaves (blue) are not aligned with the heatmap cells (red grid), and that the dendrogram has only 13 leaves whereas the dataframe has 18 rows.<br>
Any ideas why?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/54399273/119454847-48f91100-bd39-11eb-80cb-4525ba44e5cd.png"><img width="300" alt="image" src="https://user-images.githubusercontent.com/54399273/119454847-48f91100-bd39-11eb-80cb-4525ba44e5cd.png" style="max-width: 100%;"></a></p>
<p dir="auto">Versions<br>
Seaborn 0.11.1<br>
Scipy 1.6.3<br>
Pandas 1.2.4</p>
<p dir="auto">Somehow similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="759817206" data-permission-text="Title is private" data-url="https://github.com/mwaskom/seaborn/issues/2377" data-hovercard-type="issue" data-hovercard-url="/mwaskom/seaborn/issues/2377/hovercard" href="https://github.com/mwaskom/seaborn/issues/2377">#2377</a>, but for <code class="notranslate">kind='hist'</code> and with <code class="notranslate">common_norm=False</code> being ignored.</p>
<p dir="auto">If I understand it well, passing <code class="notranslate">common_norm=False</code> to <code class="notranslate">sns.distplot</code> should produce plots with independent "z" scale. While this is the behaviour for kde plots, it seems to be ignored for bivariate histograms unless hue is also specified.</p>
<p dir="auto">Test case:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x, y = np.random.randn(2, 200)
z = [0] * 150 + [1] * 50
sns.displot(x=x, y=y, col=z, kind=&quot;hist&quot;, cbar=True, common_norm=False)
sns.displot(x=x, y=y, col=z, hue=z, kind=&quot;hist&quot;, cbar=True, common_norm=False)"><pre class="notranslate"><span class="pl-s1">x</span>, <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">2</span>, <span class="pl-c1">200</span>)
<span class="pl-s1">z</span> <span class="pl-c1">=</span> [<span class="pl-c1">0</span>] <span class="pl-c1">*</span> <span class="pl-c1">150</span> <span class="pl-c1">+</span> [<span class="pl-c1">1</span>] <span class="pl-c1">*</span> <span class="pl-c1">50</span>
<span class="pl-s1">sns</span>.<span class="pl-en">displot</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s1">x</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s1">y</span>, <span class="pl-s1">col</span><span class="pl-c1">=</span><span class="pl-s1">z</span>, <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">"hist"</span>, <span class="pl-s1">cbar</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">common_norm</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
<span class="pl-s1">sns</span>.<span class="pl-en">displot</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s1">x</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s1">y</span>, <span class="pl-s1">col</span><span class="pl-c1">=</span><span class="pl-s1">z</span>, <span class="pl-s1">hue</span><span class="pl-c1">=</span><span class="pl-s1">z</span>, <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">"hist"</span>, <span class="pl-s1">cbar</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">common_norm</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)</pre></div>
<p dir="auto">Running seaborn version 0.11.1<br>
(I tried to look for other (open or closed) related issues, hope not duplicating them)</p>