1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| % Des pays
countries = {'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H'};
n = numel(countries);
% Des donnees d'echanges
links = triu(rand(n));
links(1:n+1:end) = 0;
th = linspace(0, 2*pi, n);
th(end) = [];
r = 1;
figure
% Trace des points rouges correspondant aux pays
x = r*cos(th);
y = r*sin(th);
p = plot(0, 0, 'ro', x, y, 'ro');
set(p, 'markerfacecolor', 'r', 'markersize', 12)
hold on
% Affichage du nom des pays
xt = 1.1*r*cos(th);
yt = 1.1*r*sin(th);
text([0 xt], [0 yt], countries)
% Affichage des lignes correspondant aux echanges
[i,j,v] = find(links);
x = [0 x];
y = [0 y];
h = line([x(i) ; x(j)], [y(i) ; y(j)],'color','k');
% Epaisseur relative des lignes des echanges
t = round(3*(v-min(v(:)))/(max(v(:))-min(v(:))))+1;
for n = 1:numel(h)
set(h(n), 'linewidth', t(n));
end
axis equal off |
Partager