SAE_VisualisationDonnees/ex1/ex1.sce

50 lines
1.8 KiB
Scilab
Raw Normal View History

2023-05-14 17:28:48 +02:00
2023-05-20 01:30:13 +02:00
data = csvRead("../data.csv");
2023-05-14 17:28:48 +02:00
2023-05-20 01:30:13 +02:00
Superficie=data(:,2);
Population=data(:,3);
2023-05-14 17:28:48 +02:00
surfaceTerrestre=cumsum(Superficie)(207)
nbHabitants=cumsum(Population)(207)
DensitéMoyenne=mean(((nbHabitants * 10^6) / (surfaceTerrestre * 10^3)))
SurfaceAfrique=cumsum(data(1:57,2))(57)
HabitantsAfrique=cumsum(data(1:57,3))(57)
DensitéMoyAfrique=mean(((HabitantsAfrique * 10^6) / (SurfaceAfrique * 10^3)))
2023-05-14 17:28:48 +02:00
SurfaceAmeriqueN=cumsum(data(58:86,2))(29)
HabitantsAmeriqueN=cumsum(data(58:86,3))(29)
DensitéMoyAmeriqueN=mean(((HabitantsAmeriqueN * 10^6) / (SurfaceAmeriqueN * 10^3)))
2023-05-14 17:28:48 +02:00
SurfaceAmeriqueS=cumsum(data(87:99,2))(13)
HabitantsAmeriqueS=cumsum(data(87:99,3))(13)
DensitéMoyAmeriqueS=mean(((HabitantsAmeriqueS * 10^6) / (SurfaceAmeriqueS * 10^3)))
2023-05-14 17:28:48 +02:00
SurfaceAsie=cumsum(data(100:150,2))(51)
HabitantsAsie=cumsum(data(100:150,3))(51)
DensitéMoyAsie=mean(((HabitantsAsie * 10^6) / (SurfaceAsie * 10^3)))
2023-05-14 17:28:48 +02:00
SurfaceEurope=cumsum(data(151:193,2))(43)
HabitantsEurope=cumsum(data(151:193,3))(43)
DensitéMoyEurope=mean(((HabitantsEurope * 10^6) / (SurfaceEurope * 10^3)))
2023-05-14 17:28:48 +02:00
SurfaceOceanie=cumsum(data(194:207,2))(14)
HabitantsOceanie=cumsum(data(194:207,3))(14)
DensitéMoyOceanie=mean(((HabitantsOceanie * 10^6) / (SurfaceOceanie * 10^3)))
2023-05-14 17:28:48 +02:00
2023-05-20 01:30:13 +02:00
DensiteMoyParContinent=[DensitéMoyAfrique, DensitéMoyAmeriqueN, DensitéMoyAmeriqueS, DensitéMoyAsie, DensitéMoyEurope, DensitéMoyOceanie];
bar(1:6, DensiteMoyParContinent)
2023-05-20 01:30:13 +02:00
RepartitionSurface=[SurfaceAfrique, SurfaceAmeriqueN, SurfaceAmeriqueS, SurfaceAsie, SurfaceEurope, SurfaceOceanie];
pie(RepartitionSurface, ["Afrique", "Amérique du Nord", "Amérique du Sud", "Asie", "Europe", "Océanie"])
2023-05-20 01:30:13 +02:00
RepartitionHabitants=[HabitantsAfrique, HabitantsAmeriqueN, HabitantsAmeriqueS, HabitantsAsie, HabitantsEurope, HabitantsOceanie];
pie(RepartitionHabitants, ["Afrique", "Amérique du Nord", "Amérique du Sud", "Asie", "Europe", "Océanie"])
2023-05-14 17:28:48 +02:00