How to label scatter plot with different name?(not number)

1 回表示 (過去 30 日間)
Weixu Pan
Weixu Pan 2018 年 2 月 23 日
回答済み: Chandani Madnani 2018 年 2 月 26 日
I have
x=randi([50 100],1,20);
y=randi([0 60],1,20);
figure
scatter(x,y);
hold on
plot(x(1:20),y(1:20),'w.');
hold on;
for k=1:20
text(x(k),y(k),{k});
end
Picture I want generate was attached
Thanks!

回答 (1 件)

Chandani Madnani
Chandani Madnani 2018 年 2 月 26 日
Please see the following link:
https://www.mathworks.com/matlabcentral/answers/315124-how-do-i-display-custom-text-for-the-data-cursor

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!