<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Calling show() after generating a simple line plot causes my machine to log my user out in what appears to be a forced shutdown. This problem only occurs when running python through terminal and not through a Jupyter Notebook (though in a notebook I have to run the cell twice to see any results).</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 numpy as np
import matplotlib.pyplot as plt

cond1 = np.array([25]*10)

plt.plot(cond1)

plt.show()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<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">cond1</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">25</span>]<span class="pl-c1">*</span><span class="pl-c1">10</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">cond1</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">show</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="(base) Johns-MacBook-Pro:Work_Code johnwilson$ python condition_numbers_new.py 
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.649 python[11487:59261] HIToolbox: received notification of WindowServer event port death.
2019-08-27 16:28:51.649 python[11487:59261] port matched the WindowServer port created in BindCGSToRunLoop"><pre class="notranslate"><code class="notranslate">(base) Johns-MacBook-Pro:Work_Code johnwilson$ python condition_numbers_new.py 
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.643 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.644 python[11487:59261] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-08-27 16:28:51.649 python[11487:59261] HIToolbox: received notification of WindowServer event port death.
2019-08-27 16:28:51.649 python[11487:59261] port matched the WindowServer port created in BindCGSToRunLoop
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">This code should produce the following plot (generated by running the above code in a jupyter notebook) instead of shutting down.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/29575095/63810335-2464d080-c8ea-11e9-97ea-42167f8dd08b.png"><img width="388" alt="Screen Shot 2019-08-27 at 4 45 45 PM" src="https://user-images.githubusercontent.com/29575095/63810335-2464d080-c8ea-11e9-97ea-42167f8dd08b.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: macOS Mojave, Version 10.14.6</li>
<li>Matplotlib version: 3.1.0</li>
<li>Matplotlib backend: module://ipykernel.pylab.backend_inline</li>
<li>Python version: Python 3.7.3</li>
<li>Jupyter version:
<ul dir="auto">
<li>jupyter==1.0.0</li>
<li>jupyter-client==5.3.1</li>
<li>jupyter-console==6.0.0</li>
<li>jupyter-core==4.5.0</li>
</ul>
</li>
<li>Other libraries:
<ul dir="auto">
<li>numpy==1.16.4</li>
</ul>
</li>
</ul>
<p dir="auto">I installed everything through the Anaconda distribution using default settings just last week.</p>
<p dir="auto">The weekly build with nightly wheels from numpy and pandas<br>
has failed. Check the logs for any updates that need to be<br>
made in matplotlib.<br>
<a href="https://github.com/matplotlib/matplotlib/actions/runs/4390878412">https://github.com/matplotlib/matplotlib/actions/runs/4390878412</a></p>