<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">When <code class="notranslate">boxplot</code> is called multiple times on the same axis with <code class="notranslate">manage_ticks=True</code>, ticks and labels can get duplicated and be overdrawn.</p>
<p dir="auto">I believe this problem to be caused in <a href="https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L4062-L4072">https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L4062-L4072</a> because there, on the second boxplot call, the new <code class="notranslate">locs</code> of the <code class="notranslate">FixedLocator</code> and <code class="notranslate">seq</code> of <code class="notranslate">FixedFormatter</code> are just appended to the previous ones without removing duplicates.</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.pyplot as plt

fig, ax = plt.subplots(1, 1)
_ = ax.scatter(['a'], [1])
_ = ax.scatter(['a'], [1])
fig.canvas.draw()

print(ax.xaxis.get_ticklabels())
# Returns [Text(0, 0, 'a')] which is ok

fig, ax = plt.subplots(1, 1)
_ = ax.boxplot([1,2,3])
_ = ax.boxplot([5,6,7])
fig.canvas.draw()

print(ax.xaxis.get_ticklabels())
# Returns [Text(1, 0, '1'), Text(1, 0, '1')] which causes overdrawn labels"><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">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>)
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">scatter</span>([<span class="pl-s">'a'</span>], [<span class="pl-c1">1</span>])
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">scatter</span>([<span class="pl-s">'a'</span>], [<span class="pl-c1">1</span>])
<span class="pl-s1">fig</span>.<span class="pl-s1">canvas</span>.<span class="pl-en">draw</span>()

<span class="pl-en">print</span>(<span class="pl-s1">ax</span>.<span class="pl-s1">xaxis</span>.<span class="pl-en">get_ticklabels</span>())
<span class="pl-c"># Returns [Text(0, 0, 'a')] which is ok</span>

<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>)
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">boxplot</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">boxplot</span>([<span class="pl-c1">5</span>,<span class="pl-c1">6</span>,<span class="pl-c1">7</span>])
<span class="pl-s1">fig</span>.<span class="pl-s1">canvas</span>.<span class="pl-en">draw</span>()

<span class="pl-en">print</span>(<span class="pl-s1">ax</span>.<span class="pl-s1">xaxis</span>.<span class="pl-en">get_ticklabels</span>())
<span class="pl-c"># Returns [Text(1, 0, '1'), Text(1, 0, '1')] which causes overdrawn labels</span></pre></div>
<p dir="auto">The boxplot above is quite unreasonable, however this problem rises also in saner plots, such as the case of two shared axes with one boxplot each.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt

fig, ax = plt.subplots(2, 1, sharex=True)
_ = ax[0].boxplot([1,2,3])
_ = ax[1].boxplot([1,2,3])

fig.canvas.draw()

print(ax[1].xaxis.get_ticklabels())
# Returns [Text(1, 0, '1'), Text(1, 0, '1')]"><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">fig</span>, <span class="pl-s1">ax</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">sharex</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>[<span class="pl-c1">0</span>].<span class="pl-en">boxplot</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])
<span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>[<span class="pl-c1">1</span>].<span class="pl-en">boxplot</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])

<span class="pl-s1">fig</span>.<span class="pl-s1">canvas</span>.<span class="pl-en">draw</span>()

<span class="pl-en">print</span>(<span class="pl-s1">ax</span>[<span class="pl-c1">1</span>].<span class="pl-s1">xaxis</span>.<span class="pl-en">get_ticklabels</span>())
<span class="pl-c"># Returns [Text(1, 0, '1'), Text(1, 0, '1')]</span></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">I think that, in the instance of the shared axes, a user should not be required to set <code class="notranslate">manage_ticks=False</code> and set the locators and formatters by themselves in order to get the correct result.<br>
But that is debatable, so I actually wonder if this is a bug or intended behaviour.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Windows 10</li>
<li>Matplotlib version: 3.3.2</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): TkAgg</li>
<li>Python version: 3.7.5</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries:</li>
</ul>
<p dir="auto">It would be nice to migrate to py.test which seems to have more features and better usability than nose at this point.</p>
<p dir="auto">This is potentially a large chunk of work given how customized our nose environment is.</p>