Hi,

I know this may be a question for scipy or numarray but since matplotlib is using something close to what I wish to have..., here is the question:

- I would like to use some 2D interpolation of a set of x, y, z points (not regularly positioned). If possible I would like to test various interpolation schemes (bilinear, splines, etc), and have a FLAG to tell me if I am trying to EXTRAPOLATE (so that I can control the output). I looked at scipy but this is really bad: as far as I understand the doc mentions that it takes 1D array (what I want), but in fact works on 2D arrays (NOT what I want).... (and it only provides splines)

I know that imshow has this built in with many different options for the visualisation. So how is this done? Is it hard coded in one of the matplotlib routine ? Could not find it there...

thanks for the help

Eric Emsellem

On Jul 19, 2005, at 2:17 AM, Eric Emsellem wrote:

> - I would like to use some 2D interpolation of a set of x, y, z points > (not regularly positioned). If possible I would like to test various > interpolation schemes (bilinear, splines, etc), and have a FLAG to > tell me if I am trying to EXTRAPOLATE (so that I can control the > output). I looked at scipy but this is really bad: as far as I > understand the doc mentions that it takes 1D array (what I want), but > in fact works on 2D arrays (NOT what I want).... (and it only provides > splines)

You have at least 2 general approaches: Delaunay triangulation and splines. Straight Delaunay triangulation would be linear interpolation, but can be embellished with fancier interpolation techniques. As far as I know, Delaunay triangulation and associated interpolation routines are not (yet) available in scipy. Surface splines are available in scipy -- check out bisplrep/bisplev.

As far as a FLAG to tell if you want to EXTRAPOLATE, I don"t know. They may not be in ALL CAPS, either, so read the fine print.

> I know that imshow has this built in with many different options for > the visualisation. So how is this done? Is it hard coded in one of the > matplotlib routine ? Could not find it there...

I don"t think imshow does anything as fancy as what you suggest. The contour routines are more sophisticated and may be useful to you, but I haven"t followed how they work.