How can I locate the legend of specific points close to each of them in a plot ?
2 次查看(过去 30 天)
显示 更早的评论
I want to plot the legend of each point close to those as in this example, but I couldn´t. Thanks in advance.
回答(1 个)
Chunru
2021-8-15
You can use "text" command to accomplish it. Code below show you the idea:
% Generate some data (similar but different from yours)
theta = 22.5:45:360;
x = cosd(theta); y=sind(theta);
l = "T"+(1:length(theta)); % specify label
plot(x, y, 'o');
text(x+0.03, y, l)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!