<h3 dir="auto">Only one legend entry is rendered for items with the same label and color</h3>
<p dir="auto">In Matplotlib 2.1.1, items that have the same label and color result in a single legend entry. This happens even if some other properties of the items are different (eg. marker or linewidth).</p>
<p dir="auto">This behaviour is surprising because the style of the first item is used for the handle, regardless of the style of the following items.</p>
<p dir="auto">I would expect either the behaviour from Matplotlib 2.1.0, or the labels being merged only if the label and <strong>all</strong> style properties are equal.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
plt.plot([0, 1], [0, 1], label='foo', color='k', marker='o', linewidth=1)
plt.plot([0, 1], [1, 2], label='foo', color='k', marker='.', linewidth=2)
plt.plot([0, 1], [2, 3], label='bar', color='k', marker='s', linewidth=3)
plt.legend()
plt.savefig('foobar.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">as</span> <span class="pl-s1">mpl</span>
<span class="pl-s1">mpl</span>.<span class="pl-en">use</span>(<span class="pl-s">'Agg'</span>)
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'foo'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'k'</span>, <span class="pl-s1">marker</span><span class="pl-c1">=</span><span class="pl-s">'o'</span>, <span class="pl-s1">linewidth</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>], <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'foo'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'k'</span>, <span class="pl-s1">marker</span><span class="pl-c1">=</span><span class="pl-s">'.'</span>, <span class="pl-s1">linewidth</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'bar'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'k'</span>, <span class="pl-s1">marker</span><span class="pl-c1">=</span><span class="pl-s">'s'</span>, <span class="pl-s1">linewidth</span><span class="pl-c1">=</span><span class="pl-c1">3</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">legend</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'foobar.png'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome (Matplotlib 2.1.1)</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/9514702/34212958-326c036e-e59e-11e7-8cb6-2b55e7afd6d1.png"><img src="https://user-images.githubusercontent.com/9514702/34212958-326c036e-e59e-11e7-8cb6-2b55e7afd6d1.png" alt="foobar_211" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome (Matplotlib 2.1.0)</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/9514702/34213037-6315912e-e59e-11e7-8132-b4c8095e3227.png"><img src="https://user-images.githubusercontent.com/9514702/34213037-6315912e-e59e-11e7-8132-b4c8095e3227.png" alt="foobar_210" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Operating system: Arch Linux</li>
<li>Matplotlib version: 2.1.1</li>
<li>Matplotlib backend: agg</li>
<li>Python version: 3.6.3</li>
<li>Matplotlib installed from Arch Linux repository <code class="notranslate">community/python-matplotlib</code>.</li>
</ul>
<p dir="auto">When using <code class="notranslate">%matplotlib notebook</code> with the procedural interface, figures are not closed when the red 'x' button is pressed (the figure becomes static, but the figure object is not closed).</p>
<p dir="auto">After closing the figure by clicking on the red 'x' button, no other plot is displayed until <code class="notranslate">close()</code> is called. Is this a deliberate choice?  I think it may be confusing for newbies.</p>
<p dir="auto">DISCLAIMER: I know that the OO interface is preferred. However, the procedural interface has its use-case for a first-time users (plus allows saving some typing).</p>