フィルターのクリア

changing the location of num2str

1 回表示 (過去 30 日間)
KalMandy
KalMandy 2017 年 1 月 11 日
回答済み: Walter Roberson 2017 年 1 月 11 日
Hi, I am using the following to illustrate the index of the (x,y) location inside a polygon. text(x(i),y(i),num2str(i) With the above code I get the numbers exactly on the (x,y) point. Does someone know how to change that location?

採用された回答

Stephen23
Stephen23 2017 年 1 月 11 日
編集済み: Stephen23 2017 年 1 月 11 日
Add an offset to the x (and/or y) location:
d = 0.01;
text(x(i)+d,y(i),num2str(i))
Remember that x and y are data units: you will need to pick a value of d that makes sense for your data.
  1 件のコメント
KalMandy
KalMandy 2017 年 1 月 11 日
Thank you very much!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 1 月 11 日
text() offers horizontal and vertical alignment options so that you can say whether the text is to begin at that coordinates or end there or be centered there.

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by