How do a scatter plot with names?
11 次查看(过去 30 天)
显示 更早的评论
Hello evreyone, is someone able to get a graph as in the picture that I attached? Using the dataset down.
The scatter plot I got wasn't clear and I am not able to set the name of the point in the graph
ABN Amro 0.0304610987866259
Banque Postale 0.0125500802914051
Barclays 0.0751066947093279
Bayern LB 0
BBVA 0.0272140113130582
BNP Paribas 0.0570048997365625
BPCE 0.0315985393572815
Caixabank 0.00937909528302126
Commerzbank 0.0433994300187407
Credit Agricole 0.0648025139435753
Credit Mutuel 0.0250060877609688
Danske Bank 0.0241676093788770
Deutsche Bank 0.0783261905654609
DNB 0
DZ Bank 0.0798765484414847
Erste Group 0
Handelsbanken 0
HSBC 0.0933062429249327
ING 0.0578695583873232
Intesa Sanpaolo 0.0632893079254154
KBC 0
Lloyds 0.0264976990943249
Nationwide 0.00185915849074004
Nordea 0
Nykredit 0
Rabobank 0.0110645406871962
Sabadell 0
Santander 0.0381992230340928
SEB 0
Societe Generale 0.0700013574821183
Standard Chartered 0
Swedbank 0
Unicredit 0.0790201123874667
0 个评论
采纳的回答
yanqi liu
2021-9-29
sir,please check the follow code to get some information
clc; clear all; close all;
str={' ABN Amro 0.0304610987866259 ',...
'Banque Postale 0.0125500802914051 ',...
'Barclays 0.0751066947093279 ',...
'Bayern LB 0 ',...
'BBVA 0.0272140113130582 ',...
'BNP Paribas 0.0570048997365625 ',...
'BPCE 0.0315985393572815 ',...
'Caixabank 0.00937909528302126 ',...
'Commerzbank 0.0433994300187407 ',...
'Credit Agricole 0.0648025139435753 ',...
'Credit Mutuel 0.0250060877609688 ',...
'Danske Bank 0.0241676093788770 ',...
'Deutsche Bank 0.0783261905654609 ',...
'DNB 0 ',...
'DZ Bank 0.0798765484414847 ',...
'Erste Group 0 ',...
'Handelsbanken 0 ',...
'HSBC 0.0933062429249327 ',...
'ING 0.0578695583873232 ',...
'Intesa Sanpaolo 0.0632893079254154 ',...
'KBC 0 ',...
'Lloyds 0.0264976990943249 ',...
'Nationwide 0.00185915849074004 ',...
'Nordea 0 ',...
'Nykredit 0 ',...
'Rabobank 0.0110645406871962 ',...
'Sabadell 0 ',...
'Santander 0.0381992230340928 ',...
'SEB 0 ',...
'Societe Generale 0.0700013574821183 ',...
'Standard Chartered 0 ',...
'Swedbank 0 ',...
'Unicredit 0.0790201123874667 '};
tis = [];
for i =1 : length(str)
si = strtrim(str{i});
spc = strfind(si, ' ');
ti = si(1:spc(end));
yi = str2num(si(spc(end)+1:end));
xy(i,:) = [i yi];
tis{i} = ti;
end
figure; textscatter(xy,tis,'MarkerSize',15)
0 个评论
更多回答(2 个)
yanqi liu
2021-9-26
sir, i think should provide both x and y data to make location, and use text to display chars
0 个评论
Pratyush Roy
2021-9-28
Hi Andrea,
The following link might be helpful for doing scatter plot with display of text data:
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!