tytamu
tytamu

Reputation: 565

get the y coordinates by clicking on the plot in matlab

I am trying to get the y coordinates on a xy plot by clicking on the plot. This is very similar to the function ginput which will generate a cursor and by clicking on the plot you can get the x and y coordinates where the cursor is placed. However, for my particular purpose, I want to have a line cross the figure instead of cursor as a guide of determining the right y value to use. Is there any function in matlab can do this? If not, what is the way to do it? Any help is greatly appreciated.

Upvotes: 0

Views: 939

Answers (1)

foglerit
foglerit

Reputation: 8269

I don't believe there is a pre-packaged function for that, but you can do it using the strategies described in this video tutorial from Doug Hull, with slight modifications.

Upvotes: 1

Related Questions