<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">It crashes on Mac Osx.</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="from matplotlib import pyplot as plt
plt.figure()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</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">figure</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="2019-03-07 11:14:39.220 python[13951:2853154] -[QNSApplication _setup:]: unrecognized selector sent to instance 0x7fc9418afd10
2019-03-07 11:14:39.222 python[13951:2853154] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[QNSApplication _setup:]: unrecognized selector sent to instance 0x7fc9418afd10'
*** First throw call stack:"><pre class="notranslate"><code class="notranslate">2019-03-07 11:14:39.220 python[13951:2853154] -[QNSApplication _setup:]: unrecognized selector sent to instance 0x7fc9418afd10
2019-03-07 11:14:39.222 python[13951:2853154] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[QNSApplication _setup:]: unrecognized selector sent to instance 0x7fc9418afd10'
*** First throw call stack:
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>


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

<ul dir="auto">
<li>Operating system: OSX 10.13.6</li>
<li>Matplotlib version: 3.0.3</li>
<li>Matplotlib backend (<code class="notranslate">TkAgg</code>):</li>
<li>Python version: 3.6.5</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries:</li>
</ul>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I installed Matplotlib by pip"><pre class="notranslate"><code class="notranslate">I installed Matplotlib by pip
</code></pre></div>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto"><code class="notranslate">plt.plot()</code> fails with error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="libc++abi.dylib: terminating with uncaught exception of type NSException"><pre class="notranslate"><code class="notranslate">libc++abi.dylib: terminating with uncaught exception of type NSException
</code></pre></div>
<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="from matplotlib import pyplot as plt

plt.plot()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</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">plot</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="2019-02-11 22:09:09.936 python[17037:389239] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fab105e6460
2019-02-11 22:09:09.937 python[17037:389239] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fab105e6460'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff43503ded __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff6f5cf720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff43581195 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff434a5a60 ___forwarding___ + 1486
	4   CoreFoundation                      0x00007fff434a5408 _CF_forwarding_prep_0 + 120
	5   libtk8.6.dylib                      0x0000000122c6531d TkpInit + 413
	6   libtk8.6.dylib                      0x0000000122bbd17e Initialize + 2622
	7   _tkinter.cpython-37m-darwin.so      0x00000001229e5a0f _tkinter_create + 1183
	8   python                              0x000000010eb5a8b6 _PyMethodDef_RawFastCallKeywords + 230
	9   python                              0x000000010ec9ab47 call_function + 247
	10  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	11  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	12  python                              0x000000010eb59577 _PyFunction_FastCallDict + 231
	13  python                              0x000000010ebdd0b1 slot_tp_init + 193
	14  python                              0x000000010ebe7091 type_call + 241
	15  python                              0x000000010eb5a283 _PyObject_FastCallKeywords + 179
	16  python                              0x000000010ec9abe4 call_function + 404
	17  python                              0x000000010ec98778 _PyEval_EvalFrameDefault + 45528
	18  python                              0x000000010eb5a078 function_code_fastcall + 120
	19  python                              0x000000010ec9aafe call_function + 174
	20  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	21  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	22  python                              0x000000010eb59577 _PyFunction_FastCallDict + 231
	23  python                              0x000000010eb5d4a2 method_call + 130
	24  python                              0x000000010eb5aef2 PyObject_Call + 130
	25  python                              0x000000010ec988cf _PyEval_EvalFrameDefault + 45871
	26  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	27  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	28  python                              0x000000010ec9aafe call_function + 174
	29  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	30  python                              0x000000010eb5a078 function_code_fastcall + 120
	31  python                              0x000000010ec9aafe call_function + 174
	32  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	33  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	34  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	35  python                              0x000000010ec9aafe call_function + 174
	36  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	37  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	38  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	39  python                              0x000000010ec9aafe call_function + 174
	40  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	41  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	42  python                              0x000000010ecf0c40 PyRun_FileExFlags + 256
	43  python                              0x000000010ecf00b7 PyRun_SimpleFileExFlags + 391
	44  python                              0x000000010ed1c7ec pymain_main + 9564
	45  python                              0x000000010eb2ca9d main + 125
	46  libdyld.dylib                       0x00007fff7069ded9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException"><pre class="notranslate"><code class="notranslate">2019-02-11 22:09:09.936 python[17037:389239] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fab105e6460
2019-02-11 22:09:09.937 python[17037:389239] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fab105e6460'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff43503ded __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff6f5cf720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff43581195 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff434a5a60 ___forwarding___ + 1486
	4   CoreFoundation                      0x00007fff434a5408 _CF_forwarding_prep_0 + 120
	5   libtk8.6.dylib                      0x0000000122c6531d TkpInit + 413
	6   libtk8.6.dylib                      0x0000000122bbd17e Initialize + 2622
	7   _tkinter.cpython-37m-darwin.so      0x00000001229e5a0f _tkinter_create + 1183
	8   python                              0x000000010eb5a8b6 _PyMethodDef_RawFastCallKeywords + 230
	9   python                              0x000000010ec9ab47 call_function + 247
	10  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	11  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	12  python                              0x000000010eb59577 _PyFunction_FastCallDict + 231
	13  python                              0x000000010ebdd0b1 slot_tp_init + 193
	14  python                              0x000000010ebe7091 type_call + 241
	15  python                              0x000000010eb5a283 _PyObject_FastCallKeywords + 179
	16  python                              0x000000010ec9abe4 call_function + 404
	17  python                              0x000000010ec98778 _PyEval_EvalFrameDefault + 45528
	18  python                              0x000000010eb5a078 function_code_fastcall + 120
	19  python                              0x000000010ec9aafe call_function + 174
	20  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	21  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	22  python                              0x000000010eb59577 _PyFunction_FastCallDict + 231
	23  python                              0x000000010eb5d4a2 method_call + 130
	24  python                              0x000000010eb5aef2 PyObject_Call + 130
	25  python                              0x000000010ec988cf _PyEval_EvalFrameDefault + 45871
	26  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	27  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	28  python                              0x000000010ec9aafe call_function + 174
	29  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	30  python                              0x000000010eb5a078 function_code_fastcall + 120
	31  python                              0x000000010ec9aafe call_function + 174
	32  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	33  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	34  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	35  python                              0x000000010ec9aafe call_function + 174
	36  python                              0x000000010ec986bf _PyEval_EvalFrameDefault + 45343
	37  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	38  python                              0x000000010eb5a783 _PyFunction_FastCallKeywords + 195
	39  python                              0x000000010ec9aafe call_function + 174
	40  python                              0x000000010ec98684 _PyEval_EvalFrameDefault + 45284
	41  python                              0x000000010ec8c2d2 _PyEval_EvalCodeWithName + 418
	42  python                              0x000000010ecf0c40 PyRun_FileExFlags + 256
	43  python                              0x000000010ecf00b7 PyRun_SimpleFileExFlags + 391
	44  python                              0x000000010ed1c7ec pymain_main + 9564
	45  python                              0x000000010eb2ca9d main + 125
	46  libdyld.dylib                       0x00007fff7069ded9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
</code></pre></div>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Operating system: macOS 10.14.3 (Mojave)</li>
<li>Matplotlib version: 3.0.2</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): TkAgg</li>
<li>Python version: 3.7.1</li>
</ul>
<p dir="auto"><code class="notranslate">miniconda</code> installed using the <a href="https://docs.conda.io/en/latest/miniconda.html" rel="nofollow">bash script</a> (version 4.6.3).</p>
<p dir="auto">Python environment created with <code class="notranslate">conda</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="conda create -n py37 python=3.7
conda activate py37"><pre class="notranslate"><code class="notranslate">conda create -n py37 python=3.7
conda activate py37
</code></pre></div>
<p dir="auto"><code class="notranslate">matrplotlib</code> installed using conda</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="conda install matplotlib"><pre class="notranslate"><code class="notranslate">conda install matplotlib
</code></pre></div>
<p dir="auto">The same error is obtained in the <code class="notranslate">base</code> environment (<code class="notranslate">matrplotlib</code> installed in the same way). Everything installed from a fresh <code class="notranslate">miniconda</code> installation, using the default channel.</p>
<p dir="auto">I've seen a bunch of open/closed similar issues, but none seem to solve the problem.</p>