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

45 次查看(过去 30 天)
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by