Finding contour polygons without matplotlib?
![](https://secure.gravatar.com/avatar/210c9055aac9f92a50ca0e0ca6ffdf8d.jpg?s=120&d=mm&r=g)
Hi all, Is there a way in scipy+numpy to calculate the contour polygons of a field z=z(x,y) without invoking matplotlib? I would like to check whether two points lie within the same contour polygons, without invoking the contouring routine from matplotlib. I would like to avoid matplotlib for two reasons. Firstly the cluster on which I work does not have matplotlib, and secondly I would like to avoid the overhead of plotting that would inevitably accompany repeated calls to the matplotlib implementation of contour. Thanks, Sourish Basu
![](https://secure.gravatar.com/avatar/d26fd60c4792510847b76af567acec27.jpg?s=120&d=mm&r=g)
I have been wanting something similar to this for a while too: the ability to define polygons by data coordinates, not by plotting - they are really a means to define regions of interest, not necessarily meant to ever be visualized. On 06/25/2012 11:54 AM, Sourish Basu wrote:
Hi all,
Is there a way in scipy+numpy to calculate the contour polygons of a field z=z(x,y) without invoking matplotlib? I would like to check whether two points lie within the same contour polygons, without invoking the contouring routine from matplotlib. I would like to avoid matplotlib for two reasons. Firstly the cluster on which I work does not have matplotlib, and secondly I would like to avoid the overhead of plotting that would inevitably accompany repeated calls to the matplotlib implementation of contour.
Thanks,
Sourish Basu _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
-- Thøger Rivera-Thorsen Ph.D. Student of astrophysics Stockholms Universitet Office: C6-3022
![](https://secure.gravatar.com/avatar/afdaaab755ef79ac9e1374882d60ae9f.jpg?s=120&d=mm&r=g)
I wrote some contour-finding code (2D only) a long time ago that has recently found a good home in the scikits-image package: http://scikits-image.org/docs/0.6/api/skimage.measure.html#find-contours On Jun 25, 2012, at 5:54 AM, Sourish Basu wrote:
Hi all,
Is there a way in scipy+numpy to calculate the contour polygons of a field z=z(x,y) without invoking matplotlib? I would like to check whether two points lie within the same contour polygons, without invoking the contouring routine from matplotlib. I would like to avoid matplotlib for two reasons. Firstly the cluster on which I work does not have matplotlib, and secondly I would like to avoid the overhead of plotting that would inevitably accompany repeated calls to the matplotlib implementation of contour.
Thanks,
Sourish Basu _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
![](https://secure.gravatar.com/avatar/afdaaab755ef79ac9e1374882d60ae9f.jpg?s=120&d=mm&r=g)
I wrote some contour-finding code (2D only) a long time ago that has recently found a good home in the scikits-image package: http://scikits-image.org/docs/0.6/api/skimage.measure.html#find-contours
Also, here's an example use: http://scikits-image.org/docs/dev/auto_examples/plot_contours.html
On Jun 25, 2012, at 5:54 AM, Sourish Basu wrote:
Hi all,
Is there a way in scipy+numpy to calculate the contour polygons of a field z=z(x,y) without invoking matplotlib? I would like to check whether two points lie within the same contour polygons, without invoking the contouring routine from matplotlib. I would like to avoid matplotlib for two reasons. Firstly the cluster on which I work does not have matplotlib, and secondly I would like to avoid the overhead of plotting that would inevitably accompany repeated calls to the matplotlib implementation of contour.
Thanks,
Sourish Basu _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
participants (3)
-
Sourish Basu
-
Thøger Rivera-Thorsen
-
Zachary Pincus