MATLAB Answers

How to display the x and y values of the cursor location on plot in GUIDE

48 views (last 30 days)
Suppose I plot a graph on an axis in MATLAB GUIDE. How do I get two static text boxes to display the x and y values of the point my cursor is hovering over? I know this can be done to show the pixel coordinates in the GUI, but when it comes to a plot I am unsure.

  0 Comments

Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 2 Oct 2018
Would this help?
doc datacursormode

  4 Comments

Show 1 older comment
Fangjun Jiang
Fangjun Jiang on 4 Oct 2018
Ha, this might work
plot(rand(1,10),'o-')
[x,y]=ginput(1);
line([x x],ylim);
line(xlim,[y y]);

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2017b