In [1]:
import scipy.interpolate
In [2]:
x = [0,0,1,1]
y = [0,1,0,1]
values = [0,0,0,9]
L = scipy.interpolate.LinearNDInterpolator(np.c_[x,y], values)
In [3]:
X, Y = np.mgrid[0:1:10j,0:1:10j]
plt.pcolor(X,Y, L(X,Y))
Out[3]:
In [24]:
x = [0,0,1,1, 0,0,1, 0,1,1]
y = [0,1,0,1, 0,1,0, 1,0,1]
values = [0,0,0,9, 0,5,5, 3,3,9]
L = scipy.interpolate.LinearNDInterpolator(np.c_[x,y], values)
In [25]:
plt.pcolor(X,Y, L(X,Y))
plt.colorbar()
plt.triplot(L.tri.points[:,0],L.tri.points[:,1], L.tri.simplices.copy())
In [12]:
scipy.interpolate.LinearNDInterpolator?
In [ ]: