matplotlib._cntr.Cntr gone in 2.2

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

matplotlib._cntr.Cntr gone in 2.2

Fabien
Hi all,

matplotlib._cntr.Cntr is gone in version 2.2. I know this was a private
module but it ended up being used by some (a quick online search will
show you some examples. ie this SO post:
https://stackoverflow.com/questions/18304722/python-find-contour-lines-from-matplotlib-pyplot-contour).

The use case for this class (as shown by the examples online) was to
obtain polygon contours of labeled regions in a 2D array.
Is there an alternative implementation available? The solutions I've
found online imply making a plot, which isn't really what I'm looking for.

Thanks a lot!

Fabien


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

Re: matplotlib._cntr.Cntr gone in 2.2

tcaswell
Fabien,

I suggest looking at skimage ( http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html ) for contouring code.

If you are absolutely dependent on that API, the source is available from previous releases and you are welcome to vendor or create a stand-alone library (not sure how hard that would actually be).

Please do not use private APIs.  We can (and will!) change them with no notice.

Tom

On Mon, Mar 5, 2018 at 3:45 AM Fabien <[hidden email]> wrote:
Hi all,

matplotlib._cntr.Cntr is gone in version 2.2. I know this was a private
module but it ended up being used by some (a quick online search will
show you some examples. ie this SO post:
https://stackoverflow.com/questions/18304722/python-find-contour-lines-from-matplotlib-pyplot-contour).

The use case for this class (as shown by the examples online) was to
obtain polygon contours of labeled regions in a 2D array.
Is there an alternative implementation available? The solutions I've
found online imply making a plot, which isn't really what I'm looking for.

Thanks a lot!

Fabien


_______________________________________________
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: matplotlib._cntr.Cntr gone in 2.2

Fabien
Hi Thomas,

On 03/05/2018 03:03 PM, Thomas Caswell wrote:
> I suggest looking at skimage (
> http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html ) for
> contouring code.

Thanks! Looks like this is exactly what I was looking for. It's probably
not around since as long as matplotlib and therefore not prominent on
the forums dealing with the question. Thanks a lot!


> Please do not use private APIs.  We can (and will!) change them with no
> notice.

You are right, but... ;-)

Best,

Fabien

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

Re: matplotlib._cntr.Cntr gone in 2.2

Fabien
> On 03/05/2018 03:03 PM, Thomas Caswell wrote:
>> I suggest looking at skimage (
>> http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html )
>> for contouring code.

For the record (and to my own surprise), it seems that skimage and the
deprecated Cntr are producing *exactly* the same results (appart from
the order of the vertices of course). I haven't tested it in all
possible cases of course, but changing to skimage simplified the code
and passed through all our tests.

Thanks!

Fabien

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