How to view the values of points on a plot?

174 ビュー (過去 30 日間)
Suchita
Suchita 2014 年 9 月 5 日
コメント済み: Gilles Desvilles 2024 年 2 月 18 日
I am plotting a circle based on list of x and y co-ordinates in a .txt as input.How can I view the points on the circle once it is plotted?

採用された回答

Geoff Hayes
Geoff Hayes 2014 年 9 月 5 日
Suchita - you could can enable the data cursor mode on the figure. For example, suppose we plot the sine wave as follows
close all;
x=-2*pi:0.0001:2*pi;
y=sin(x);
h=figure;
plot(x,y)
You can then enable the data cursor mode as
datacursormode(h,'on');
Now when the cursor moves across the figure, it has the shape of the plus symbol (cross-hairs). Clicking near a point on the sine curve snaps the cross-hairs to that point and text box appears displaying the x and y coordinate.
To turn the data cursor mode off, just type
datacursormode(h,'off');
  2 件のコメント
Suchita
Suchita 2014 年 9 月 5 日
Thanks Geoff,that was helpful!
Gilles Desvilles
Gilles Desvilles 2024 年 2 月 18 日
Do you know how to go to the next point on the plot without clicking on it, just starting from the initial point and using a key ? The arrow keys don't make it unfortunately.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by