which interpolation type is used by contour() ?

Hi Everyone,
I’d like to know, what is the underline mechanism that connects the points of my gridded data when I use
contour().
Can I control this mechanism ?
Maybe I missed it in the documentation, but it’s not clear to me.

Thanks in advance,

···


Oz Nahum
Graduate Student
Zentrum für Angewandte Geologie
Universität Tübingen


Imagine there’s no countries
it isn’t hard to do
Nothing to kill or die for

And no religion too
Imagine all the people
Living life in peace

Hi Everyone,
I'd like to know, what is the underline mechanism that connects the

points

of my gridded data when I use
contour().
Can I control this mechanism ?
Maybe I missed it in the documentation, but it's not clear to me.
Thanks in advance,

I think it's the same than this used in the imshow method. Would you
like to check ?

greetings.

Hi Everyone,
I'd like to know, what is the underline mechanism that connects the

points

of my gridded data when I use
contour().
Can I control this mechanism ?

No. If you want smoother contours you can either use a 2-D interpolation method to map your data to a finer grid and then use that for contouring, or you can use a spline algorithm to smooth the contour paths directly. There are more problems and pitfalls with the second method than with the first, so don't bother trying it.

Maybe I missed it in the documentation, but it's not clear to me.
Thanks in advance,

I think it's the same than this used in the imshow method. Would you
like to check ?

No, image display and contouring use completely different algorithms. Imshow uses any of several 2-D interpolation methods to map values given on one square grid onto another square grid. It does not create paths; it simply displays pixels. In contouring, linear interpolation is used to find the intersections between contour level lines and grid lines; the intersection points are connected by line segments; and the line segments are assembled into complete contour paths, which are then drawn (contour) or filled (contourf).

Eric

···

On 06/13/2010 10:27 PM, David Kremer wrote:

greetings.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Eric,
Thanks for your reply. I’ve already suspected that it’s a simple linear interpolation like in matlab.
And for better interpolation I should use griddata on a finer grid. That’s all clear now !

···


Oz Nahum
Graduate Student
Zentrum für Angewandte Geologie

Universität Tübingen


Imagine there’s no countries
it isn’t hard to do
Nothing to kill or die for
And no religion too
Imagine all the people
Living life in peace