<p dir="auto">With the current master, I am finding that interactivity can break in case of errors.<br>
This is one example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import matplotlib
&gt;&gt;&gt; matplotlib.use(&quot;tkagg&quot;)
&gt;&gt;&gt; from pylab import *
&gt;&gt;&gt; figure()
&lt;matplotlib.figure.Figure object at 0x103b03150&gt;
&gt;&gt;&gt; line, = plot([1,2,3])
&gt;&gt;&gt; line
&lt;matplotlib.lines.Line2D object at 0x108f81350&gt;
&gt;&gt;&gt; line.set_dashes
&lt;bound method Line2D.set_dashes of &lt;matplotlib.lines.Line2D object at 0x108f81350&gt;&gt;
&gt;&gt;&gt; line.set_dashes('--') # incorrect usage of set_dashes
&gt;&gt;&gt; Exception in Tkinter callback
Traceback (most recent call last):
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py&quot;, line 1536, in __call__
    return self.func(*args)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py&quot;, line 587, in callit
    func(*args)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_tkagg.py&quot;, line 370, in idle_draw
    self.draw()
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_tkagg.py&quot;, line 354, in draw
    FigureCanvasAgg.draw(self)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_agg.py&quot;, line 471, in draw
    self.figure.draw(self.renderer)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py&quot;, line 60, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/figure.py&quot;, line 1119, in draw
    func(*args)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py&quot;, line 60, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/axes/_base.py&quot;, line 2169, in draw
    a.draw(renderer)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py&quot;, line 60, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py&quot;, line 741, in draw
    drawFunc(renderer, gc, tpath, affine.frozen())
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py&quot;, line 1154, in _draw_lines
    self._lineFunc(renderer, gc, path, trans)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py&quot;, line 1201, in _draw_dashed
    renderer.draw_path(gc, path, trans)
  File &quot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_agg.py&quot;, line 166, in draw_path
    self._renderer.draw_path(gc, path, transform, rgbFace)
TypeError: a float is required

&gt;&gt;&gt; plot([1,2,4])
# nothing happens

&gt;&gt;&gt; cla()
# nothing happens"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">matplotlib</span>.<span class="pl-en">use</span>(<span class="pl-s">"tkagg"</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">from</span> <span class="pl-s1">pylab</span> <span class="pl-k">import</span> <span class="pl-c1">*</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">figure</span>()
<span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">figure</span>.<span class="pl-v">Figure</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x103b03150</span><span class="pl-c1">&gt;</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">line</span>, <span class="pl-c1">=</span> <span class="pl-en">plot</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">line</span>
<span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">lines</span>.<span class="pl-v">Line2D</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x108f81350</span><span class="pl-c1">&gt;</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">line</span>.<span class="pl-s1">set_dashes</span>
<span class="pl-c1">&lt;</span><span class="pl-s1">bound</span> <span class="pl-s1">method</span> <span class="pl-v">Line2D</span>.<span class="pl-s1">set_dashes</span> <span class="pl-s1">of</span> <span class="pl-c1">&lt;</span><span class="pl-s1">matplotlib</span>.<span class="pl-s1">lines</span>.<span class="pl-v">Line2D</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x108f81350</span><span class="pl-c1">&gt;&gt;</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">line</span>.<span class="pl-en">set_dashes</span>(<span class="pl-s">'--'</span>) <span class="pl-c"># incorrect usage of set_dashes</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-v">Exception</span> <span class="pl-c1">in</span> <span class="pl-v">Tkinter</span> <span class="pl-s1">callback</span>
<span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1536</span>, <span class="pl-s1">in</span> <span class="pl-s1">__call__</span>
    <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">func</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">587</span>, <span class="pl-s1">in</span> <span class="pl-s1">callit</span>
    <span class="pl-en">func</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_tkagg.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">370</span>, <span class="pl-s1">in</span> <span class="pl-s1">idle_draw</span>
    <span class="pl-s1">self</span>.<span class="pl-en">draw</span>()
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_tkagg.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">354</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw</span>
    <span class="pl-v">FigureCanvasAgg</span>.<span class="pl-en">draw</span>(<span class="pl-s1">self</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_agg.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">471</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw</span>
    <span class="pl-s1">self</span>.<span class="pl-s1">figure</span>.<span class="pl-en">draw</span>(<span class="pl-s1">self</span>.<span class="pl-s1">renderer</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">60</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw_wrapper</span>
    <span class="pl-en">draw</span>(<span class="pl-s1">artist</span>, <span class="pl-s1">renderer</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/figure.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1119</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw</span>
    <span class="pl-en">func</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">60</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw_wrapper</span>
    <span class="pl-en">draw</span>(<span class="pl-s1">artist</span>, <span class="pl-s1">renderer</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/axes/_base.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2169</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw</span>
    <span class="pl-s1">a</span>.<span class="pl-en">draw</span>(<span class="pl-s1">renderer</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/artist.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">60</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw_wrapper</span>
    <span class="pl-en">draw</span>(<span class="pl-s1">artist</span>, <span class="pl-s1">renderer</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">741</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw</span>
    <span class="pl-en">drawFunc</span>(<span class="pl-s1">renderer</span>, <span class="pl-s1">gc</span>, <span class="pl-s1">tpath</span>, <span class="pl-s1">affine</span>.<span class="pl-en">frozen</span>())
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1154</span>, <span class="pl-s1">in</span> <span class="pl-s1">_draw_lines</span>
    <span class="pl-s1">self</span>.<span class="pl-en">_lineFunc</span>(<span class="pl-s1">renderer</span>, <span class="pl-s1">gc</span>, <span class="pl-s1">path</span>, <span class="pl-s1">trans</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/lines.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1201</span>, <span class="pl-s1">in</span> <span class="pl-s1">_draw_dashed</span>
    <span class="pl-s1">renderer</span>.<span class="pl-en">draw_path</span>(<span class="pl-s1">gc</span>, <span class="pl-s1">path</span>, <span class="pl-s1">trans</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_agg.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">166</span>, <span class="pl-s1">in</span> <span class="pl-s1">draw_path</span>
    <span class="pl-s1">self</span>.<span class="pl-s1">_renderer</span>.<span class="pl-en">draw_path</span>(<span class="pl-s1">gc</span>, <span class="pl-s1">path</span>, <span class="pl-s1">transform</span>, <span class="pl-s1">rgbFace</span>)
<span class="pl-v">TypeError</span>: <span class="pl-s1">a</span> <span class="pl-s1">float</span> <span class="pl-c1">is</span> <span class="pl-s1">required</span>

<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">plot</span>([<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">4</span>])
<span class="pl-c"># nothing happens</span>

<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">cla</span>()
<span class="pl-c"># nothing happens</span></pre></div>
<p dir="auto">Resizing the figure restores interactivity.</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Setting axis ticks in a small log scale produces duplicate tick labels.</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()
s = 10
ax.axis([s, 100, 10, 100])
ax.loglog([20, 30], [30, 40])
from matplotlib.ticker import ScalarFormatter
for axis in [ax.xaxis, ax.yaxis]:
    axis.set_major_formatter(ScalarFormatter())

ax.set_xticks([20, 55])
ax.set_yticks([20, 55])
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-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-s1">s</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span>
<span class="pl-s1">ax</span>.<span class="pl-en">axis</span>([<span class="pl-s1">s</span>, <span class="pl-c1">100</span>, <span class="pl-c1">10</span>, <span class="pl-c1">100</span>])
<span class="pl-s1">ax</span>.<span class="pl-en">loglog</span>([<span class="pl-c1">20</span>, <span class="pl-c1">30</span>], [<span class="pl-c1">30</span>, <span class="pl-c1">40</span>])
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">ticker</span> <span class="pl-k">import</span> <span class="pl-v">ScalarFormatter</span>
<span class="pl-k">for</span> <span class="pl-s1">axis</span> <span class="pl-c1">in</span> [<span class="pl-s1">ax</span>.<span class="pl-s1">xaxis</span>, <span class="pl-s1">ax</span>.<span class="pl-s1">yaxis</span>]:
    <span class="pl-s1">axis</span>.<span class="pl-en">set_major_formatter</span>(<span class="pl-v">ScalarFormatter</span>())

<span class="pl-s1">ax</span>.<span class="pl-en">set_xticks</span>([<span class="pl-c1">20</span>, <span class="pl-c1">55</span>])
<span class="pl-s1">ax</span>.<span class="pl-en">set_yticks</span>([<span class="pl-c1">20</span>, <span class="pl-c1">55</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><strong>Actual outcome</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6657200/42314213-26c86c36-8077-11e8-853e-47a387d7d72a.png"><img src="https://user-images.githubusercontent.com/6657200/42314213-26c86c36-8077-11e8-853e-47a387d7d72a.png" alt="figure_1" style="max-width: 100%;"></a></p>

<p dir="auto"><strong>change code a little bit</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()
s = 9
ax.axis([s, 100, 10, 100])
ax.loglog([20, 30], [30, 40])
from matplotlib.ticker import ScalarFormatter
for axis in [ax.xaxis, ax.yaxis]:
    axis.set_major_formatter(ScalarFormatter())
ax.set_xticks([20, 55])
ax.set_yticks([20, 55])
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-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-s1">s</span> <span class="pl-c1">=</span> <span class="pl-c1">9</span>
<span class="pl-s1">ax</span>.<span class="pl-en">axis</span>([<span class="pl-s1">s</span>, <span class="pl-c1">100</span>, <span class="pl-c1">10</span>, <span class="pl-c1">100</span>])
<span class="pl-s1">ax</span>.<span class="pl-en">loglog</span>([<span class="pl-c1">20</span>, <span class="pl-c1">30</span>], [<span class="pl-c1">30</span>, <span class="pl-c1">40</span>])
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">ticker</span> <span class="pl-k">import</span> <span class="pl-v">ScalarFormatter</span>
<span class="pl-k">for</span> <span class="pl-s1">axis</span> <span class="pl-c1">in</span> [<span class="pl-s1">ax</span>.<span class="pl-s1">xaxis</span>, <span class="pl-s1">ax</span>.<span class="pl-s1">yaxis</span>]:
    <span class="pl-s1">axis</span>.<span class="pl-en">set_major_formatter</span>(<span class="pl-v">ScalarFormatter</span>())
<span class="pl-s1">ax</span>.<span class="pl-en">set_xticks</span>([<span class="pl-c1">20</span>, <span class="pl-c1">55</span>])
<span class="pl-s1">ax</span>.<span class="pl-en">set_yticks</span>([<span class="pl-c1">20</span>, <span class="pl-c1">55</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><strong>Expected outcome</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6657200/42314434-91b84156-8077-11e8-8409-aac5a95962c4.png"><img src="https://user-images.githubusercontent.com/6657200/42314434-91b84156-8077-11e8-8409-aac5a95962c4.png" alt="figure_2" style="max-width: 100%;"></a></p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Ubuntu 16.04</li>
<li>Matplotlib version: 2.2.2</li>
<li>Matplotlib backend: Qt5Agg</li>
<li>Python version: 3.6</li>
</ul>