<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt

ax = plt.axes()
ax.axhline(5)
plt.plot(pd.date_range('2020-01', '2020-01-03'), [10, 15, 20])
plt.tick_params(labelcolor='white')"><pre class="notranslate"><code class="notranslate">import matplotlib.pyplot as plt

ax = plt.axes()
ax.axhline(5)
plt.plot(pd.date_range('2020-01', '2020-01-03'), [10, 15, 20])
plt.tick_params(labelcolor='white')
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15331990/99341842-441a4880-2850-11eb-879e-0b55646b524f.png"><img src="https://user-images.githubusercontent.com/15331990/99341842-441a4880-2850-11eb-879e-0b55646b524f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">I expect the start to be 2020-01, not 2000-01.</p>
<p dir="auto">Without date times, it works as expected (start = 10):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ax = plt.axes()
ax.axhline(5)
plt.plot([10, 15, 20], [10, 15, 20])
plt.tick_params(labelcolor='white')"><pre class="notranslate"><code class="notranslate">ax = plt.axes()
ax.axhline(5)
plt.plot([10, 15, 20], [10, 15, 20])
plt.tick_params(labelcolor='white')
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15331990/99341881-5ac09f80-2850-11eb-924b-4f689acfd13a.png"><img src="https://user-images.githubusercontent.com/15331990/99341881-5ac09f80-2850-11eb-924b-4f689acfd13a.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">If I plot an <code class="notranslate">axhline</code> first, and then two points with <code class="notranslate">plot_date</code>, the x-axis is not rescaled to the two new data points:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
from datetime import datetime

fig, axs = plt.subplots(2, 1)

axs[0].axhline(1.5)
axs[0].plot([datetime(2016, 1, 1, 0, 0, 0), datetime(2016, 1, 2, 0, 0, 0)], [1, 2])

axs[1].plot([datetime(2016, 1, 1, 0, 0, 0), datetime(2016, 1, 2, 0, 0, 0)], [1, 2])
axs[1].axhline(1.5)

plt.show()"><pre class="notranslate"><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-k">from</span> <span class="pl-s1">datetime</span> <span class="pl-k">import</span> <span class="pl-s1">datetime</span>

<span class="pl-s1">fig</span>, <span class="pl-s1">axs</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">2</span>, <span class="pl-c1">1</span>)

<span class="pl-s1">axs</span>[<span class="pl-c1">0</span>].<span class="pl-en">axhline</span>(<span class="pl-c1">1.5</span>)
<span class="pl-s1">axs</span>[<span class="pl-c1">0</span>].<span class="pl-en">plot</span>([<span class="pl-en">datetime</span>(<span class="pl-c1">2016</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>), <span class="pl-en">datetime</span>(<span class="pl-c1">2016</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>)], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>])

<span class="pl-s1">axs</span>[<span class="pl-c1">1</span>].<span class="pl-en">plot</span>([<span class="pl-en">datetime</span>(<span class="pl-c1">2016</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>), <span class="pl-en">datetime</span>(<span class="pl-c1">2016</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>)], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>])
<span class="pl-s1">axs</span>[<span class="pl-c1">1</span>].<span class="pl-en">axhline</span>(<span class="pl-c1">1.5</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6197628/21652428/81cc21c2-d2a4-11e6-86e5-c9235507a643.png"><img src="https://cloud.githubusercontent.com/assets/6197628/21652428/81cc21c2-d2a4-11e6-86e5-c9235507a643.png" alt="figure_1-1" style="max-width: 100%;"></a></p>
<p dir="auto">I would expect the two plots to be the same, and the plotting order not to matter.</p>
<p dir="auto">Present on current master (2.0.0rc2.post2912+g015d8d5) and on 1.5</p>