Finding annotation location dynamically?
2 次查看(过去 30 天)
显示 更早的评论
I am creating plots similar to one below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159760/image.jpeg)
A numeric is written next to each curve that shows an iteration. In my plot,I am adding these numbers using annotation(.) but I have to adjust their position manually? Is it possible that This can be done dynamically.
0 个评论
采纳的回答
Image Analyst
2016-4-1
For each curve, get x and y
labelX = x(end) + 0.1;
labelY = y(end);
text(labelX, labelY, string);
Make up string with sprintf() and put whatever you want in it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!