Interpolation method of python matplotlib contourf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Interpolation method of python matplotlib contourf

Athanasios Karagiannidis
Hello to all

I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?

Best regards

Sakis

Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interpolation method of python matplotlib contourf

Ian Thomas-8
Hello Sakis,

All of Matplotlib's contouring functions (contour, contourf, tricontour, tricontourf) use linear interpolation along grid edges.  This is not explicitly documented anywhere.

Are there other interpolation options that you would like?  I can think of logarithmic as one possibility.

Ian

On Tue, 2 Feb 2021 at 10:08, Athanasios Karagiannidis <[hidden email]> wrote:
Hello to all

I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?

Best regards

Sakis

Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interpolation method of python matplotlib contourf

Athanasios Karagiannidis
Hello Ian

Another interpolation may come handy in the future. Is it possible to control the interpolation method?

The fact that the current interpolation method is not documented is a pity. I need to reference it in a manuscript...

Sakis
Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]


From: Ian Thomas <[hidden email]>
Sent: Tuesday, February 2, 2021 1:17 PM
To: Athanasios Karagiannidis <[hidden email]>
Cc: [hidden email] <[hidden email]>
Subject: Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
 
Hello Sakis,

All of Matplotlib's contouring functions (contour, contourf, tricontour, tricontourf) use linear interpolation along grid edges.  This is not explicitly documented anywhere.

Are there other interpolation options that you would like?  I can think of logarithmic as one possibility.

Ian

On Tue, 2 Feb 2021 at 10:08, Athanasios Karagiannidis <[hidden email]> wrote:
Hello to all

I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?

Best regards

Sakis

Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interpolation method of python matplotlib contourf

Ian Thomas-8
Hi Sakis,

No, you cannot control the interpolation method, you are stuck with linear for now.  It is on my wishlist for future improvements, but this is no help to you now.

To demonstrate that it is linear interpolation I would reference the code, e.g. https://github.com/matplotlib/matplotlib/blob/ea6803254567eaaa9adb027b541a6885d9fa246f/src/_contour.cpp#L1345-L1354 is the C++ interpolation function which is self-evidently linear interpolation.  I am not sure if that link is good enough for a manuscript though.

Ian

On Tue, 2 Feb 2021 at 12:22, Athanasios Karagiannidis <[hidden email]> wrote:
Hello Ian

Another interpolation may come handy in the future. Is it possible to control the interpolation method?

The fact that the current interpolation method is not documented is a pity. I need to reference it in a manuscript...

Sakis
Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]


From: Ian Thomas <[hidden email]>
Sent: Tuesday, February 2, 2021 1:17 PM
To: Athanasios Karagiannidis <[hidden email]>
Cc: [hidden email] <[hidden email]>
Subject: Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
 
Hello Sakis,

All of Matplotlib's contouring functions (contour, contourf, tricontour, tricontourf) use linear interpolation along grid edges.  This is not explicitly documented anywhere.

Are there other interpolation options that you would like?  I can think of logarithmic as one possibility.

Ian

On Tue, 2 Feb 2021 at 10:08, Athanasios Karagiannidis <[hidden email]> wrote:
Hello to all

I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?

Best regards

Sakis

Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interpolation method of python matplotlib contourf

Athanasios Karagiannidis

Hello again Ian

I can work with linear, no problem!

Regarding, the reference: The link may not be sufficient. I depend.  I guess I may have to find a general reference for the linear interpolation to incorporate in my manuscript.

Thank you very much!

Best regards

Sakis
Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]


From: Ian Thomas <[hidden email]>
Sent: Tuesday, February 2, 2021 2:44 PM
To: Athanasios Karagiannidis <[hidden email]>
Cc: [hidden email] <[hidden email]>
Subject: Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
 
Hi Sakis,

No, you cannot control the interpolation method, you are stuck with linear for now.  It is on my wishlist for future improvements, but this is no help to you now.

To demonstrate that it is linear interpolation I would reference the code, e.g. https://github.com/matplotlib/matplotlib/blob/ea6803254567eaaa9adb027b541a6885d9fa246f/src/_contour.cpp#L1345-L1354 is the C++ interpolation function which is self-evidently linear interpolation.  I am not sure if that link is good enough for a manuscript though.

Ian

On Tue, 2 Feb 2021 at 12:22, Athanasios Karagiannidis <[hidden email]> wrote:
Hello Ian

Another interpolation may come handy in the future. Is it possible to control the interpolation method?

The fact that the current interpolation method is not documented is a pity. I need to reference it in a manuscript...

Sakis
Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]


From: Ian Thomas <[hidden email]>
Sent: Tuesday, February 2, 2021 1:17 PM
To: Athanasios Karagiannidis <[hidden email]>
Cc: [hidden email] <[hidden email]>
Subject: Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
 
Hello Sakis,

All of Matplotlib's contouring functions (contour, contourf, tricontour, tricontourf) use linear interpolation along grid edges.  This is not explicitly documented anywhere.

Are there other interpolation options that you would like?  I can think of logarithmic as one possibility.

Ian

On Tue, 2 Feb 2021 at 10:08, Athanasios Karagiannidis <[hidden email]> wrote:
Hello to all

I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?

Best regards

Sakis

Athanasios F. Karagiannidis
Physicist, PhD Meteorology and Climatology
E-mail: [hidden email]
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Interpolation method of python matplotlib contourf

vincent.adrien@gmail.com
Hi all,

Sakis, are you saying that if the (linear) interpolation scheme was simply mentionned in the relevant docstring (I imagine some place like `matplotlib.axes.contour{f}` or `matplotlib.contour.{Quad}ContourSet`), then it would be enough regarding your need for a reference? I guess that a quick PR to fix what seems to be a small yet quite unfortunate
hole in the documentation anyway would be welcome, would it not?

Best regards,
Adrien

Le 02/02/2021 à 14:49, Athanasios Karagiannidis a écrit :

>
> Hello again Ian
>
> I can work with linear, no problem!
>
> Regarding, the reference: The link may not be sufficient. I depend.  I guess I may have to find a general reference for the linear interpolation to incorporate in my manuscript.
>
> Thank you very much!
>
> Best regards
>
> Sakis
>
> Athanasios F. Karagiannidis
> Physicist, PhD Meteorology and Climatology
> E-mail: [hidden email]
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* Ian Thomas <[hidden email]>
> *Sent:* Tuesday, February 2, 2021 2:44 PM
> *To:* Athanasios Karagiannidis <[hidden email]>
> *Cc:* [hidden email] <[hidden email]>
> *Subject:* Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
>  
> Hi Sakis,
>
> No, you cannot control the interpolation method, you are stuck with linear for now.  It is on my wishlist for future improvements, but this is no help to you now.
>
> To demonstrate that it is linear interpolation I would reference the code, e.g. https://github.com/matplotlib/matplotlib/blob/ea6803254567eaaa9adb027b541a6885d9fa246f/src/_contour.cpp#L1345-L1354 <https://github.com/matplotlib/matplotlib/blob/ea6803254567eaaa9adb027b541a6885d9fa246f/src/_contour.cpp#L1345-L1354> is the C++ interpolation function which is self-evidently linear interpolation.  I am not sure if that link is good enough for a manuscript though.
>
> Ian
>
> On Tue, 2 Feb 2021 at 12:22, Athanasios Karagiannidis <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Hello Ian
>
>     Another interpolation may come handy in the future. Is it possible to control the interpolation method?
>
>     The fact that the current interpolation method is not documented is a pity. I need to reference it in a manuscript...
>
>     Sakis
>
>     Athanasios F. Karagiannidis
>     Physicist, PhD Meteorology and Climatology
>     E-mail: [hidden email] <mailto:[hidden email]>
>
>
>     ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>     *From:* Ian Thomas <[hidden email] <mailto:[hidden email]>>
>     *Sent:* Tuesday, February 2, 2021 1:17 PM
>     *To:* Athanasios Karagiannidis <[hidden email] <mailto:[hidden email]>>
>     *Cc:* [hidden email] <mailto:[hidden email]> <[hidden email] <mailto:[hidden email]>>
>     *Subject:* Re: [Matplotlib-users] Interpolation method of python matplotlib contourf
>      
>     Hello Sakis,
>
>     All of Matplotlib's contouring functions (contour, contourf, tricontour, tricontourf) use linear interpolation along grid edges.  This is not explicitly documented anywhere.
>
>     Are there other interpolation options that you would like?  I can think of logarithmic as one possibility.
>
>     Ian
>
>     On Tue, 2 Feb 2021 at 10:08, Athanasios Karagiannidis <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Hello to all
>
>         I want to ask what is the default interpolation method of python matplotlib contourf? Where can I find relative documentation? Could someone help me?
>
>         Best regards
>
>         Sakis
>
>         Athanasios F. Karagiannidis
>         Physicist, PhD Meteorology and Climatology
>         E-mail: [hidden email] <mailto:[hidden email]>
>
>         _______________________________________________
>         Matplotlib-users mailing list
>         [hidden email] <mailto:[hidden email]>
>         https://mail.python.org/mailman/listinfo/matplotlib-users <https://mail.python.org/mailman/listinfo/matplotlib-users>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users