<p dir="auto">I noticed that <a href="https://codecov.io/gh/matplotlib/matplotlib/src/master/lib/matplotlib/tests/test_constrainedlayout.py" rel="nofollow">coverage</a> of <code class="notranslate">test_constrainedlayout.py</code> was only 87.6%. It turns out that the function <code class="notranslate">test_constrained_layout8</code> is duplicated in the test file. I can't tell if this is just complete duplication, or duplication of the name only.</p>
<p dir="auto">Say one finds a pathological natural-neighbour <code class="notranslate">griddata</code> case that <code class="notranslate">matplotlib.delaunay</code> can't handle so installs <code class="notranslate">natgrid</code>, which can cope with your data but is pretty slow.  Unfortunately if <code class="notranslate">natgrid</code> is importable then it will always be used in preference to the quicker <code class="notranslate">matplotlib.delaunay</code>.  It would be great if there were a <code class="notranslate">griddata</code> argument for selecting <code class="notranslate">matplotlib.delaunay</code> or <code class="notranslate">natgrid</code> at runtime.</p>
<p dir="auto">The interp keyword argument could be used for this purpose e.g.</p>
<ul dir="auto">
<li><code class="notranslate">nn</code> - <code class="notranslate">matplotlib.delaunay</code> natural neighbour interpolation</li>
<li><code class="notranslate">linear</code> - <code class="notranslate">matplotlib.delaunay</code> linear interpolation</li>
<li><code class="notranslate">natgrid</code> - natural neighbour interpolation using <code class="notranslate">natgrid</code> (if installed)</li>
</ul>
<p dir="auto">Something that's worth considering is a failover mode where interpolation usig <code class="notranslate">natgrid</code> is attempted only if <code class="notranslate">matplotlib.delaunay</code> fails (with a <code class="notranslate">KeyError</code> (!)).</p>