How to get level values by X Y coordinates from a contour plot?

Hi everyone, I have a image which name is Image1, then I used the contour function with contour(double(Image1)); after which I get a 2-D contour plot. Then is it feasible if I want to get the level values of the contour plot with x coordinate from ,say 100 to 200 when corresponding y coordinate from 100 to 200. Breifly speaking, is it feasible that I want to get the level values of that 10000 points from contour plot(100*100). If so, how? Thanks

5 Comments

Is the question about finding out what level values were using in a contour plot, or is the question about getting contour() to use particular level values that you specify?
Hi Walter, thanks for your reply. When I used the contour function, I got a contour figure from matlab. Then if I use datatip function,I can get points values as (X,Y and Level) for points, thus my question is that how can I get the level values corresponding to their X Y co-ordinates. For instance, if set X from 100,101,102 to 200, Y also from 100,101,102 to 200. I want to get the level values for these 10000 points. Is it feasible?if so what is the function used? I tried some functions such as getContourLineCoordinates, contourdata, but they didn't work as what I try to get.Thanks.
Are you using custom levels or letting it pick the levels?
I just used a photo as image, then turn it into black-white mode for the contour, the level values on the plot is dependent on the pixel value of the photo.
Now I consider to draw a grid on the contour plot and get the values of grid points.

Sign in to comment.

Answers (1)

Read the documentation of contour..there is option of getting level values fromt he function.
[M,c] = contour(X,Y,Z) ;

Categories

Products

Release

R2019b

Asked:

on 10 Feb 2020

Commented:

on 10 Feb 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!