matplotlib – extracting data from contour lines

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]

Leave a Comment