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

25 ビュー (過去 30 日間)
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.

採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 10 月 2 日
Would this help?
doc datacursormode
  4 件のコメント
Chamath Vithanawasam
Chamath Vithanawasam 2018 年 10 月 4 日
That's quite alright, thanks for your help!
Fangjun Jiang
Fangjun Jiang 2018 年 10 月 4 日
Ha, this might work
plot(rand(1,10),'o-')
[x,y]=ginput(1);
line([x x],ylim);
line(xlim,[y y]);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by