<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">This was working until recently. Started failing all of the sudden after a Windows 10 update.</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

plt.ion()
fig = plt.figure('test')"><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">ion</span>()
<span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>(<span class="pl-s">'test'</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;C:/###/Code/####/_test_matplitlib_bug.py&quot;, line 4, in &lt;module&gt;
    fig = plt.figure('test')
  File &quot;C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\pyplot.py&quot;, line 557, in figure
    draw_if_interactive()
  File &quot;C:\Users\#####\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\1##\helpers\pycharm_matplotlib_backend\backend_interagg.py&quot;, line 39, in draw_if_interactive
    figManager.canvas.show()
  File &quot;C:\Users\#####\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\1##\helpers\pycharm_matplotlib_backend\backend_interagg.py&quot;, line 62, in show
    self.figure.tight_layout()
  File &quot;C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\figure.py&quot;, line 1753, in tight_layout
    rect=rect)
  File &quot;C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\tight_layout.py&quot;, line 326, in get_tight_layout_figure
    max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "C:/###/Code/####/_test_matplitlib_bug.py", line 4, in &lt;module&gt;
    fig = plt.figure('test')
  File "C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\pyplot.py", line 557, in figure
    draw_if_interactive()
  File "C:\Users\#####\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\1##\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 39, in draw_if_interactive
    figManager.canvas.show()
  File "C:\Users\#####\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\1##\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 62, in show
    self.figure.tight_layout()
  File "C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\figure.py", line 1753, in tight_layout
    rect=rect)
  File "C:\Anaconda3\envs\py27_sp\lib\site-packages\matplotlib\tight_layout.py", line 326, in get_tight_layout_figure
    max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>


<p dir="auto">It was working before a Windows 10 update.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Windows 10 Home (10.0.17134) Build 171 34</li>
<li>Matplotlib version: 2.0.2</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): module://backend_interagg</li>
<li>Python version: Python 2.7.13 :: Continuum Analytics, Inc.</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries:</li>
</ul>


<p dir="auto">Installed with conda. Default channels.</p>
<p dir="auto">I have an animated graph using <code class="notranslate">FuncAnimation</code>. I call tight_layout() on resize to fix the layout:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fig.canvas.mpl_connect('resize_event', lambda *x: plt.tight_layout())"><pre class="notranslate"><code class="notranslate">fig.canvas.mpl_connect('resize_event', lambda *x: plt.tight_layout())
</code></pre></div>
<p dir="auto">Mostly resizing the window works fine. Sometimes this leads to an exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/usr/lib/python3.5/tkinter/__init__.py&quot;, line 1553, in __call__
    return self.func(*args)
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py&quot;, line 279, in resize
    self.resize_event()
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/backend_bases.py&quot;, line 1833, in resize_event
    self.callbacks.process(s, event)
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/cbook.py&quot;, line 554, in process
    proxy(*args, **kwargs)
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/cbook.py&quot;, line 416, in __call__
    return mtd(*args, **kwargs)
  File &quot;./monitor.py&quot;, line 199, in &lt;lambda&gt;
    fig.canvas.mpl_connect('resize_event', lambda *x: plt.tight_layout())
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/pyplot.py&quot;, line 1406, in tight_layout
    fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/figure.py&quot;, line 1753, in tight_layout
    rect=rect)
  File &quot;/home/user/project/env/lib/python3.5/site-packages/matplotlib/tight_layout.py&quot;, line 326, in get_tight_layout_figure
    max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence
Exception in Tkinter callback"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1553, in __call__
    return self.func(*args)
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py", line 279, in resize
    self.resize_event()
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 1833, in resize_event
    self.callbacks.process(s, event)
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/cbook.py", line 554, in process
    proxy(*args, **kwargs)
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/cbook.py", line 416, in __call__
    return mtd(*args, **kwargs)
  File "./monitor.py", line 199, in &lt;lambda&gt;
    fig.canvas.mpl_connect('resize_event', lambda *x: plt.tight_layout())
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1406, in tight_layout
    fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/figure.py", line 1753, in tight_layout
    rect=rect)
  File "/home/user/project/env/lib/python3.5/site-packages/matplotlib/tight_layout.py", line 326, in get_tight_layout_figure
    max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence
Exception in Tkinter callback
</code></pre></div>
<p dir="auto">I hope for someone this trace is useful. Unfortunately I can not provide a minimal example.</p>
<p dir="auto">matplotlib==2.0.1</p>