<h3 dir="auto">Bug report</h3>
<p dir="auto">Plotting with string categorical data fails, if the second call to <code class="notranslate">plt.scatter</code> contains categories not present in the first call to <code class="notranslate">plt.scatter</code><br>
<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.pyplot as plt
plt.scatter([&quot;a&quot;, &quot;b&quot;], [0,2])
plt.scatter([&quot;a&quot;,&quot;c&quot;], [1,4])"><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-s1">plt</span>.<span class="pl-en">scatter</span>([<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>], [<span class="pl-c1">0</span>,<span class="pl-c1">2</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">scatter</span>([<span class="pl-s">"a"</span>,<span class="pl-s">"c"</span>], [<span class="pl-c1">1</span>,<span class="pl-c1">4</span>])</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;xxx/python3.6/site-packages/matplotlib/pyplot.py&quot;, line 3357, in scatter
    edgecolors=edgecolors, data=data, **kwargs)
  File &quot;xxx/python3.6/site-packages/matplotlib/__init__.py&quot;, line 1710, in inner
    return func(ax, *args, **kwargs)
  File &quot;xxx/python3.6/site-packages/matplotlib/axes/_axes.py&quot;, line 4010, in scatter
    x = self.convert_xunits(x)
  File &quot;xxx/python3.6/site-packages/matplotlib/artist.py&quot;, line 191, in convert_xunits
    return ax.xaxis.convert_units(x)
  File &quot;xxx/python3.6/site-packages/matplotlib/axis.py&quot;, line 1491, in convert_units
    ret = self.converter.convert(x, self.units, self)
  File &quot;xxx/python3.6/site-packages/matplotlib/category.py&quot;, line 53, in convert
    return vals.astype('float')
ValueError: could not convert string to float: 'c'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "xxx/python3.6/site-packages/matplotlib/pyplot.py", line 3357, in scatter
    edgecolors=edgecolors, data=data, **kwargs)
  File "xxx/python3.6/site-packages/matplotlib/__init__.py", line 1710, in inner
    return func(ax, *args, **kwargs)
  File "xxx/python3.6/site-packages/matplotlib/axes/_axes.py", line 4010, in scatter
    x = self.convert_xunits(x)
  File "xxx/python3.6/site-packages/matplotlib/artist.py", line 191, in convert_xunits
    return ax.xaxis.convert_units(x)
  File "xxx/python3.6/site-packages/matplotlib/axis.py", line 1491, in convert_units
    ret = self.converter.convert(x, self.units, self)
  File "xxx/python3.6/site-packages/matplotlib/category.py", line 53, in convert
    return vals.astype('float')
ValueError: could not convert string to float: 'c'
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/662579/32447797-5d2f9ad8-c30d-11e7-8a67-c5c7ff3c903b.png"><img src="https://user-images.githubusercontent.com/662579/32447797-5d2f9ad8-c30d-11e7-8a67-c5c7ff3c903b.png" alt="figure_1" style="max-width: 100%;"></a></p>
<p dir="auto">Figure generated using</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plt.plot([&quot;a&quot;, &quot;b&quot;], [0,2], &quot;o&quot;)
plt.plot([&quot;a&quot;, &quot;c&quot;], [1,4], &quot;o&quot;)"><pre class="notranslate"><span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>], [<span class="pl-c1">0</span>,<span class="pl-c1">2</span>], <span class="pl-s">"o"</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-s">"a"</span>, <span class="pl-s">"c"</span>], [<span class="pl-c1">1</span>,<span class="pl-c1">4</span>], <span class="pl-s">"o"</span>)</pre></div>
<p dir="auto">Using different categories for subsequent calls to <code class="notranslate">plt.plot</code> works as expected.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Fedora</li>
<li>Matplotlib version: 2.1.0 (installed the manylinux binary wheel via pip)</li>
<li>Matplotlib backend: TkAgg</li>
<li>Python version: 3.6.2</li>
</ul>
<p dir="auto">Alerted to by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/anntzer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/anntzer">@anntzer</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="264362884" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/9350" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/9350/hovercard" href="https://github.com/matplotlib/matplotlib/issues/9350">#9350</a>, the fill_between with all categorical doesn't do an update on the y2 and so the following code:</p>
<p dir="auto"><code class="notranslate">plt.fill_between(['a', 'b', 'c'], ['e', 'f', 'g'],['h','i','j'])</code></p>
<p dir="auto">Crashes on the lookup:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/projects/matplotlib/lib/matplotlib/artist.py in convert_yunits(self, y)
    198         if ax is None or ax.yaxis is None:
    199             return y
--&gt; 200         return ax.yaxis.convert_units(y)
    201 
    202     @property

~/projects/matplotlib/lib/matplotlib/axis.py in convert_units(self, x)
   1489             return x
   1490 
-&gt; 1491         ret = self.converter.convert(x, self.units, self)
   1492         return ret
   1493 "><pre class="notranslate"><code class="notranslate">/projects/matplotlib/lib/matplotlib/artist.py in convert_yunits(self, y)
    198         if ax is None or ax.yaxis is None:
    199             return y
--&gt; 200         return ax.yaxis.convert_units(y)
    201 
    202     @property

~/projects/matplotlib/lib/matplotlib/axis.py in convert_units(self, x)
   1489             return x
   1490 
-&gt; 1491         ret = self.converter.convert(x, self.units, self)
   1492         return ret
   1493 
</code></pre></div>
<p dir="auto">This seems to be limited to categoricals because dates work as expected:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
import pandas as pd
dates = pd.date_range('1990-10-10', '2004-10-10', freq='M')
x = np.arange(84)
y1 = dates[:84]
y2 = dates[84:]
plt.fill_between(x, y2, y1)"><pre class="notranslate"><code class="notranslate">import numpy as np
import pandas as pd
dates = pd.date_range('1990-10-10', '2004-10-10', freq='M')
x = np.arange(84)
y1 = dates[:84]
y2 = dates[84:]
plt.fill_between(x, y2, y1)
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1300499/31840038-97bef180-b5b1-11e7-8964-b5da1c009242.png"><img src="https://user-images.githubusercontent.com/1300499/31840038-97bef180-b5b1-11e7-8964-b5da1c009242.png" alt="index" style="max-width: 100%;"></a></p>
<p dir="auto">And as <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/anntzer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/anntzer">@anntzer</a> suggested, the axis behavior should be modified such that once units are set on that axis, the axis should error out if new input isn't in the same units. As expected, the following errors out: <code class="notranslate">plt.fill_between(x, x, y1)</code></p>