SAE24_2022/resources/scripts/ex1-3.sce
Lyanis SOUIDI 9501d51450
[Ex1 - Q3] Modification du graph
Co-authored-by: Dimitrijevic <hugo.dimitrijevic@etu.u-pec.fr>
2023-05-18 18:03:54 +02:00

15 lines
768 B
Scilab

data = csvRead("resources/data/data.csv");
densiteAfrique = sum(data(1:57, 3)* 1000000) / sum(data(1:57, 2)* 1000);
densiteAmeriqueDuNord = sum(data(58:86, 3)* 1000000) / sum(data(58:86, 2)* 1000);
densiteAmeriqueDuSud = sum(data(87:99, 3)* 1000000) / sum(data(87:99, 2)* 1000);
densiteAsie = sum(data(100:150, 3)* 1000000) / sum(data(100:150, 2)* 1000);
densiteEurope = sum(data(151:193, 3)* 1000000) / sum(data(151:193, 2)* 1000);
densiteOceanie = sum(data(194:207, 3)* 1000000) / sum(data(194:207, 2)* 1000);
bar([densiteAfrique, densiteAmeriqueDuNord, densiteAmeriqueDuSud, densiteAsie, densiteEurope, densiteOceanie]);
title("Densité de population par continent");
xlabel("Continent");
ylabel("Densité (habitants/km²)");
xs2png(0,"resources/img/ex1-3.png");