15 lines
768 B
Scilab
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");
|