<p dir="auto">In my installation (seaborn 0.6.0, matplotlib 1.5.1 with Qt2 back end under Linux Mint, Python 3.5), the annotation feature of heatmaps doesn't work. When I run the "Annotated heatmap" example from the <a href="https://stanford.edu/~mwaskom/software/seaborn/examples/heatmap_annotation.html" rel="nofollow">project website</a>, only the cell in the lower left corner has an annotation (in a wrong color):</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12086562/12489905/04f63956-c073-11e5-82e6-4cd10927a5c6.png"><img src="https://cloud.githubusercontent.com/assets/12086562/12489905/04f63956-c073-11e5-82e6-4cd10927a5c6.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">The same issue also occurs with other data sets:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sns.heatmap(
    pd.DataFrame({
        'wanna': {'ACAD': 53, 'MAG': 490, 'NEWS': 249}, 
        'gonna': {'ACAD': 202, 'MAG': 1974, 'NEWS': 1207}}), 
    annot=True)"><pre class="notranslate"><span class="pl-s1">sns</span>.<span class="pl-en">heatmap</span>(
    <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({
        <span class="pl-s">'wanna'</span>: {<span class="pl-s">'ACAD'</span>: <span class="pl-c1">53</span>, <span class="pl-s">'MAG'</span>: <span class="pl-c1">490</span>, <span class="pl-s">'NEWS'</span>: <span class="pl-c1">249</span>}, 
        <span class="pl-s">'gonna'</span>: {<span class="pl-s">'ACAD'</span>: <span class="pl-c1">202</span>, <span class="pl-s">'MAG'</span>: <span class="pl-c1">1974</span>, <span class="pl-s">'NEWS'</span>: <span class="pl-c1">1207</span>}}), 
    <span class="pl-s1">annot</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12086562/12489884/e62750fa-c072-11e5-9d8c-b6c6649427e2.png"><img src="https://cloud.githubusercontent.com/assets/12086562/12489884/e62750fa-c072-11e5-9d8c-b6c6649427e2.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Issue</strong><br>
Seaborn fails to generate histograms on data frames with certain indexes (duplicated).</p>
<p dir="auto">This is wrong because the histogram is a function of a 1-D column and most not depend on frame indexes (and btw, nonunique indexes are legitimate and appear in data science tasks).</p>
<p dir="auto"><strong>Reproduce</strong></p>
<p dir="auto">Under <code class="notranslate">seaborn== 0.11.2</code> and <code class="notranslate">pandas==1.4.3</code> do:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import seaborn as sns
import pandas as pd

df = pd.DataFrame({'id':[1,1,2,2],'values':[1.0,1.0,2.0,3.0]})
df.set_index('id',inplace=True) # NOTE: this line is causing problems
sns.histplot(data=df,x='values')"><pre class="notranslate"><code class="notranslate">import seaborn as sns
import pandas as pd

df = pd.DataFrame({'id':[1,1,2,2],'values':[1.0,1.0,2.0,3.0]})
df.set_index('id',inplace=True) # NOTE: this line is causing problems
sns.histplot(data=df,x='values')
</code></pre></div>
<p dir="auto">This generates the following error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError: cannot reindex on an axis with duplicate labels"><pre class="notranslate"><code class="notranslate">ValueError: cannot reindex on an axis with duplicate labels
</code></pre></div>