matplotlib - extracting data from contour lines

from: http://matplotlib.org/api/path_api.html#module-matplotlib.path

Users of Path objects should not access the vertices and codes arrays directly. Instead, they should use iter_segments() to get the vertex/code pairs. This is important, since many Path objects, as an optimization, do not store a codes at all, but have a default one provided for them by iter_segments().

Otherwise, I'm not really sure what your question is. [Zip] is a sometimes useful built in function when working with coordinates. 1


For a given path, you can get the points like this:

p = cs.collections[0].get_paths()[0]
v = p.vertices
x = v[:,0]
y = v[:,1]