-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Let's take the sample code from the documentation
for cl in levels(contours(x,y,z))
lvl = level(cl) # the z-value of this contour level
for line in lines(cl)
xs, ys = coordinates(line) # coordinates of this line segment
end
end
I need the indices of xs and ys in x and y, i.e.in a simple world this would be:
ix = indexin(xs, x)
iy = indexin(ys, y)
this_contour = z[ix, iy]
However, xs and ys do not belong exactly to x and y, and I can't figure out how to extract the indices. The reason I need to do this is that I have an auxiliary array w that has the same shape as z, and I would like to extract the part corresponding to the contours.
Is there some way to do this? Does contour.jl return the indices somehow?