<p dir="auto">Hi!</p>
<p dir="auto">I have the following plotting code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    for idx, signal in enumerate(LIST_OF_SIGNALS):
        df_ftrs_tmp = df_ftrs.copy()
        df_ftrs_tmp.index = encode_meta(df_ftrs_tmp)
        df_ftrs_tmp = df_ftrs_tmp.filter(like=signal)

        for df_tmp_idx, df_tmp in df_ftrs_tmp.iterrows():
            label = decode_meta(df_tmp_idx)

            axes[idx].errorbar(
                list(range(5)),
                df_tmp.filter(like='[median]'),
                yerr=df_tmp.filter(like='[std]'),
                capsize=3, marker='o',
                color=colors[df_tmp_idx], label='txt{}'.format(df_tmp_idx))"><pre class="notranslate"><code class="notranslate">    for idx, signal in enumerate(LIST_OF_SIGNALS):
        df_ftrs_tmp = df_ftrs.copy()
        df_ftrs_tmp.index = encode_meta(df_ftrs_tmp)
        df_ftrs_tmp = df_ftrs_tmp.filter(like=signal)

        for df_tmp_idx, df_tmp in df_ftrs_tmp.iterrows():
            label = decode_meta(df_tmp_idx)

            axes[idx].errorbar(
                list(range(5)),
                df_tmp.filter(like='[median]'),
                yerr=df_tmp.filter(like='[std]'),
                capsize=3, marker='o',
                color=colors[df_tmp_idx], label='txt{}'.format(df_tmp_idx))
</code></pre></div>
<p dir="auto">The issue is when I'm trying to generate plots this way, legend gets 2 records for each <code class="notranslate">df_tmp_idx</code>.<br>
If I cast <code class="notranslate">as_matrix()</code> on vectors (<code class="notranslate">y</code> and <code class="notranslate">yerr</code>) before plotting, everything works as expected.<br>
So, I suppose the <code class="notranslate">Name</code>-field of dataframe row (<code class="notranslate">df_tmp</code> in this case) is being processed in any case and not correctly overwritten by <code class="notranslate">label=...</code> casting.</p>
<p dir="auto">Here are the pictures representing issue:<br>
Returned by example above:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1315589/11209298/4df9630a-8d31-11e5-8ece-1237648e219c.PNG"><img src="https://cloud.githubusercontent.com/assets/1315589/11209298/4df9630a-8d31-11e5-8ece-1237648e219c.PNG" alt="01" style="max-width: 100%;"></a><br>
Returned by example with <code class="notranslate">.as_matrix()</code> applied on vectors:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1315589/11209317/65cd207a-8d31-11e5-9463-ab8597ecf362.PNG"><img src="https://cloud.githubusercontent.com/assets/1315589/11209317/65cd207a-8d31-11e5-9463-ab8597ecf362.PNG" alt="02" style="max-width: 100%;"></a></p>
<p dir="auto">Sorry for poorly prepared example, will rework it soon.</p>
<p dir="auto">When I make an errorbar plot from pandas Series, the names of the series appear twice in the legend. Once as a solid line, and once as a solid line with error bars. Explicitly setting the label argument replaces the label text for the solid line with errorbars.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.DataFrame(data = np.random.rand(10,3),index=pd.Series(np.arange(0,20,2),name=&quot;number&quot;),columns=&quot;A B C&quot;.split())
plt.errorbar(df.index,df.A,df.B)
plt.legend()"><pre class="notranslate"><code class="notranslate">%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.DataFrame(data = np.random.rand(10,3),index=pd.Series(np.arange(0,20,2),name="number"),columns="A B C".split())
plt.errorbar(df.index,df.A,df.B)
plt.legend()
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6113878/10935717/2fc98b4c-82e8-11e5-8750-683fbc66efdc.png"><img src="https://cloud.githubusercontent.com/assets/6113878/10935717/2fc98b4c-82e8-11e5-8750-683fbc66efdc.png" alt="image" style="max-width: 100%;"></a></p>