<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149815976" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/12935" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/12935/hovercard" href="https://github.com/pandas-dev/pandas/pull/12935">#12935</a> added full support for duplicate column names (in header or in <code class="notranslate">names</code>) by mangling them.  While this has been considered <em>acceptable</em> by users, ideally, we would like to not have to mangle them.</p>
<p dir="auto">This works fine:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [13]: df = pd.DataFrame(np.random.randn(300), columns=['a'])
In [14]: df['dtime'] = pd.DatetimeIndex(start='2014-01-01', freq='h', periods=300).time
In [15]: df.plot(x='dtime', y='a')
Out[15]: &lt;matplotlib.axes._subplots.AxesSubplot at 0x118fd17f0&gt;"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">13</span>]: <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">300</span>), <span class="pl-s1">columns</span><span class="pl-c1">=</span>[<span class="pl-s">'a'</span>])
<span class="pl-v">In</span> [<span class="pl-c1">14</span>]: <span class="pl-s1">df</span>[<span class="pl-s">'dtime'</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DatetimeIndex</span>(<span class="pl-s1">start</span><span class="pl-c1">=</span><span class="pl-s">'2014-01-01'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'h'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">300</span>).<span class="pl-s1">time</span>
<span class="pl-v">In</span> [<span class="pl-c1">15</span>]: <span class="pl-s1">df</span>.<span class="pl-en">plot</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">'dtime'</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s">'a'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">15</span>]: <span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">axes</span>.<span class="pl-s1">_subplots</span>.<span class="pl-v">AxesSubplot</span> <span class="pl-s1">at</span> <span class="pl-c1">0x118fd17f0</span><span class="pl-c1">&gt;</span></pre></div>
<p dir="auto">This raises a <code class="notranslate">KeyError</code></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [17]: df.plot(x='dtime', y='a', kind='scatter')"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">17</span>]: <span class="pl-s1">df</span>.<span class="pl-en">plot</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">'dtime'</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s">'a'</span>, <span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">'scatter'</span>)</pre></div>
<p dir="auto">We call <code class="notranslate">df._get_numeric_data()</code> which excludes datetimes.<br>
May happen for other kinds too.</p>
<p dir="auto">I'll fix this; just have to decide how much refactoring.</p>
<p dir="auto">Matplotlib is ok with <code class="notranslate">datetime.time</code> values, it chokes on <code class="notranslate">datetime</code> values.</p>