フィルターのクリア

How can I use the text and sprintf functions to label a point on a graph?

47 ビュー (過去 30 日間)
Andy
Andy 2014 年 10 月 25 日
コメント済み: Star Strider 2014 年 10 月 25 日
I need to label a point with its coordinates (x = 5/6, y = 6/9) correct to 4 decimal places. The line y consists of one plot, hence the (x, y, str). When I try the following code no label appears on my graph.
x = 5/7:5/7;
y = % equation of line
plot(x, y);
str = sprintf('%0.4', 5/7, 6/9);
text(x, y, str);

採用された回答

Star Strider
Star Strider 2014 年 10 月 25 日
Try this:
text(5/7, 6/9, str);
  4 件のコメント
Andy
Andy 2014 年 10 月 25 日
Whoops. I added the 'f', works now. Thank you very much
Star Strider
Star Strider 2014 年 10 月 25 日
My pleasure!
It happens to us all...

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by