svg("Population Development Switzerland.svg", width = 15, height = 9)
year <- seq(1801, 2021)
popdevelopment <- data.frame(year)
########################################
rownames(popdevelopment) <- year
popdevelopment[3:221, "born"] <- c(62520,62180,63390,61920,61720,62400,64400,62970,64800,63630,59850,60900,65200,62700,51670,47180,65380,65740,65500,65100,66370,66110,64710,67630,64320,65910,64570,66100,66510,63820,66520,69720,70740,70730,71120,71630,71200,72080,72230,71550,71880,67270,69000,67400,61250,63660,68380,68690,67280,66000,65650,64230,61520,67330,67700,71370,75330,75310,74820,75870,79160,79600,78290,80580,77327,75705,77965,79208,77633,80329,80572,83051,87579,90786,89244,87833,86180,84165,85142,82689,81974,81571,80349,80763,81287,81098,81176,78548,83596,83125,84897,84142,84973,88428,90078,91793,94472,94316,97028,96481,93824,94867,94653,95595,94508,96245,94112,93514,91320,92196,89757,87330,75545,73660,72065,72658,72125,81190,80808,76290,75551,73508,72570,72118,69533,69594,69006,69855,69855,68650,67509,67277,66378,64966,62480,63790,63837,64115,71926,78875,83049,85627,88522,89126,87724,87763,85308,84776,81903,83549,83029,83741,85331,87912,90823,91421,92973,94372,99238,104322,109993,112890,111835,109738,107417,105130,102520,99216,96261,91342,87518,84507,78464,74199,72829,71375,71986,73661,73747,74916,73659,74710,74684,76320,76505,80345,81180,83939,86200,86910,83762,82980,82203,83007,80584,78949,78408,78458,72295,72372,71848,73082,72903,73371,74494,76691,78286,80290,80808,82164,82731,85287,86559,87883,87381,87851,86172,85914,89644)
comment(popdevelopment$born) <- "Sources: 1803- Bundesamt für Statistik Schweiz, Lebendgeburten nach Monat und Geburtenhäufigkeit seit 1803: https://www.bfs.admin.ch/bfs/de/home/statistiken/bevoelkerung/geburten-todesfaelle.assetdetail.23244081.html"
########################################
popdevelopment[3:221, "died"] <- c(40420,45780,47690,46620,47920,42300,40400,44670,52000,45030,45350,51100,41400,44400,62570,51380,47080,41140,39400,39600,40570,41510,43010,43930,39620,44010,47370,44600,43910,47320,48820,52320,47940,49630,55320,54530,52300,52380,50830,52550,52180,53670,50400,52400,52550,50660,50480,52590,54280,53800,55550,55630,58020,51930,52600,55470,55930,50910,57520,51070,54360,59500,59090,56680,59116,58730,63617,68751,74002,59758,61676,60845,66113,66819,65353,65311,63651,62223,63979,62849,58733,58301,61548,60061,58939,58229,59715,61805,61183,57178,61059,61885,59747,56096,56399,58914,57591,63606,60018,57702,59626,60857,61800,59204,59252,57697,59416,56498,59619,54102,55427,53629,51524,50623,53306,75034,54932,55992,49518,50292,45983,48988,47877,46452,49202,48063,50438,46939,49414,49911,47181,46806,50233,47650,47274,48576,49484,50759,47336,46928,47409,52336,51086,50276,51384,49679,49497,47372,49952,47624,49684,49113,50366,51573,51066,49281,50077,52094,51004,55125,56989,53609,55547,55804,55142,57374,58002,57091,57856,56489,56990,56403,55924,57095,55658,57718,57454,59097,59763,59204,60756,58602,59583,60105,59511,60648,60882,63739,62634,62302,62512,61987,63387,62637,62839,62569,62503,62528,61228,61768,63070,60180,61124,60283,61089,61233,62476,62649,62091,64173,64961,63938,67606,64964,66971,67088,67780,76195,71192)
comment(popdevelopment$died) <- "Sources: 1803- Bundesamt für Statistik Schweiz, Todesfälle nach Monat und Sterblichkeit seit 1803: https://www.bfs.admin.ch/bfs/de/home/statistiken/bevoelkerung/geburten-todesfaelle.assetdetail.23244084.html"
########################################
years <- 1803:2021
par(mar = c(2.5, 6.5, 4.0, 0)) #bottom, left, top, right
plot(years, popdevelopment$born[3:221], ylim = c(30000, 120000), bty = "l", type = "l", yaxs = "i", xlab = "", ylab = "", pch = 16, cex = 2, lab = c(10, 10, 1), col = "forestgreen", main = "Population Development in Switzerland\n(1803-2021)", cex.main = 1.5, sub = "", lwd = 4, yaxt = "n", xaxt = "n", lty = 1)
lines(years, popdevelopment$died[3:221], lty = 1, type = "l", pch = 15, cex = 2, lwd = 4, col = "navyblue")
axis(1, at = seq(1800, 2021, by = 10), las = 0, tck = 1, lty = 2, col = "#c9c9c9", lwd = 1, cex.axis = 1.5)
axis(2, at = seq(30000, 120000, by = 10000), las = 2, tck = 1, lty = 2, col = "#c9c9c9", lwd = 1, cex.axis = 1.5)
axis(2, at = seq(0, 0, by = 1), tck = 1, las = 2, lty = 2, col = "#000000", cex.axis = 1.5)
legend(x = "topright", # Position
inset = 0.02,
legend = c("Died", "Born"), # Legend texts
lty = c(1, 1),
col = c("navyblue", "forestgreen"), # Line colors
lwd = 4,
cex = 1.5)
dev.off()