Interpolates from a nonuniformly spaced grid to some other grid.
Fits a surface of the form z = f(x, y) to the data in the (usually) nonuniformly spaced vectors (x, y, z), then interpolates this surface at the points specified by (xi, yi) to produce zi.
Parameters: | x, y, z : 1d array_like
xi, yi : 1d or 2d array_like
interp : string key from {‘nn’, ‘linear’}
|
---|---|
Returns: | 2d float array :
|
Notes
If interp is ‘nn’ (the default), uses natural neighbor interpolation based on Delaunay triangulation. This option is only available if the mpl_toolkits.natgrid module is installed. This can be downloaded from https://github.com/matplotlib/natgrid. The (xi, yi) grid must be regular and monotonically increasing in this case.
If interp is ‘linear’, linear interpolation is used via matplotlib.tri.LinearTriInterpolator.
Instead of using griddata, more flexible functionality and other interpolation options are available using a matplotlib.tri.Triangulation and a matplotlib.tri.TriInterpolator.