defining/saving contours without plotting

To matplotusers:

I want to create a plot that has an image and overplots contours, but
the contours are defined relative to different data from that plotted in
the image. Is there a way to save contour line data rather than plot
it.

It just occurred to me a way of creating the plot -- but I'm still
interested in a way to save contour data.

Jon

···

--
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
jslavin@...1081... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
cell: (781) 363-0035 USA
______________________________________________________________

Hi Jon,

one thing you can do is to get the (x, y)-values of the calculated
contourlines:

cs = plt.contour(z, levels=[0])
a = cs.collections[0].get_paths()[0].vertices
# -> array of shape (..., 2) hold x and y in first and second column

I don't know wheter this is the best way, but at least for me it works.

Kind regards,
Matthias

···

On Wednesday 27 January 2010 15:14:27 Jonathan Slavin wrote:

To matplotusers:

I want to create a plot that has an image and overplots contours, but
the contours are defined relative to different data from that plotted in
the image. Is there a way to save contour line data rather than plot
it.

It just occurred to me a way of creating the plot -- but I'm still
interested in a way to save contour data.

Jon