<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">I cannot extrapolate with neither <code class="notranslate">scipy.interpolate.interp2d</code> nor <code class="notranslate">RectBivariateSpline</code>. Both return values clamped to the domain if values for coordinates outside of the domain are requested, instead of extrapolating, even though the docs state for both that for coordinates outside of the domain the value is extrapolated (<a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp2d.html" rel="nofollow">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp2d.html</a> and <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectBivariateSpline.html" rel="nofollow">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectBivariateSpline.html</a>).</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a = [-1, 1]
b = [-1, 1]
c = [[-5, 5], [-10, 0]]
i = scipy.interpolate.interp2d(a, b, c)
i(1, -2)
i(2, -2)
i(2, 2)
i(-2, 2)
i(-2, -2)"><pre class="notranslate"><span class="pl-s1">a</span> <span class="pl-c1">=</span> [<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">1</span>]
<span class="pl-s1">b</span> <span class="pl-c1">=</span> [<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">1</span>]
<span class="pl-s1">c</span> <span class="pl-c1">=</span> [[<span class="pl-c1">-</span><span class="pl-c1">5</span>, <span class="pl-c1">5</span>], [<span class="pl-c1">-</span><span class="pl-c1">10</span>, <span class="pl-c1">0</span>]]
<span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">interpolate</span>.<span class="pl-en">interp2d</span>(<span class="pl-s1">a</span>, <span class="pl-s1">b</span>, <span class="pl-s1">c</span>)
<span class="pl-en">i</span>(<span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">2</span>)
<span class="pl-en">i</span>(<span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">2</span>)
<span class="pl-en">i</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>)
<span class="pl-en">i</span>(<span class="pl-c1">-</span><span class="pl-c1">2</span>, <span class="pl-c1">2</span>)
<span class="pl-en">i</span>(<span class="pl-c1">-</span><span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">2</span>)</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="None"><pre class="notranslate">None</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto"><code class="notranslate">1.9.1 1.21.2 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)</code></p>
<p dir="auto">The documentation for interp2d [0] says that when fill_value is left as default, values outside the domain are extrapolated. It seems to just copy the nearest neighbor.</p>
<p dir="auto">[0] <a href="https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.interpolate.interp2d.html" rel="nofollow">https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.interpolate.interp2d.html</a></p>
<h3 dir="auto">Reproducing code example:</h3>
<p dir="auto"><a href="https://gist.github.com/ddasilva/1a020ff09e6fef688dd1c9acf5659f50">https://gist.github.com/ddasilva/1a020ff09e6fef688dd1c9acf5659f50</a></p>
<h3 dir="auto">Error message:</h3>
<p dir="auto">No error message occurs.</p>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="('0.19.1', '1.13.1', sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0))
In [60]:"><pre class="notranslate"><code class="notranslate">('0.19.1', '1.13.1', sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0))
In [60]:
</code></pre></div>