svg("Wanderungssaldo Deutschland.svg", width = 15, height = 9)
jahr <- seq(1901, 2022)
wanderungssalden <- data.frame(jahr)
########################################
rownames(wanderungssalden) <- jahr
wanderungssalden[91:122, "insgesamt"] <- c(602523, 782071, 462096, 314998, 397935, 282197, 93664, 47098, 201975, 167120, 272723, 219288, 142645, 82543, 78953, 22791, 43912, -55743, -12782, 127677, 279330, 368945, 428607, 550483, 1139402, 499944, 416080, 399680, 327060, 220251, 329163, 1454577)
comment(wanderungssalden$insgesamt) <- "Sources: 1991- Statistisches Bundesamt ::Wanderungen zwischen Deutschland und dem Ausland, Zugezogene, Fortgezogene und Saldo::"
########################################
wanderungssalden[91:122, "deutsche"] <- c(174718, 185679, 182908, 166757, 172675, 133307, 115432, 80553, 83740, 80665, 84451, 66519, 39949, 27326, -16764, -51902, -55091, -66428, -40288, -26248, -23528, -18204, -21857, -26441, -17560, -135364, -82478, -60320, -57625, -28356, -64179, -89722)
comment(wanderungssalden$deutsche) <- "Sources: 1991- Statistisches Bundesamt ::Wanderungen zwischen Deutschland und dem Ausland, Zugezogene, Fortgezogene und Saldo::"
########################################
wanderungssalden[91:122, "nichtdeutsche"] <- c(427805, 596392, 279188, 148241, 225260, 148890, -21768, -33455, 118235, 86455, 188272, 152769, 102696, 55217, 95717, 74693, 99003, 10685, 27506, 153925, 302858, 387149, 450464, 576924, 1156962, 635308, 498558, 460000, 384685, 248607, 393342, 1544299)
comment(wanderungssalden$nichtdeutsche) <- "Sources: 1991- Statistisches Bundesamt ::Wanderungen zwischen Deutschland und dem Ausland, Zugezogene, Fortgezogene und Saldo::"
########################################
jahre <- 1991:2022
par(mar = c(4.5, 6.5, 2.5, 0)) #bottom, left, top, right
plot(jahre, wanderungssalden$insgesamt[91:122], ylim = c(-150000, 1600000), bty = "l", type = "b", yaxs = "i", xlab = "", ylab = "", pch = 16, cex = 2, lab = c(10, 10, 1), col = "orange1", main = "Wanderungssaldo", cex.main = 2, sub = "", lwd = 2, yaxt = "n", xaxt = "n", lty = 1)
lines(jahre, wanderungssalden$nichtdeutsche[91:122], lty = 1, type = "b", pch = 15, cex = 2, lwd = 2, col = "blue")
lines(jahre, wanderungssalden$deutsche[91:122], lty = 1, type = "b", pch = 17, cex = 2, col = "limegreen", lwd = 2)
axis(1, at = seq(1991, 2022, by = 1), las = 2, tck = 1, lty = 2, col = "#c9c9c9", lwd = 1, cex.axis = 1.5)
axis(2, at = seq(-200000, 1600000, by = 100000), 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 = "topleft", # Position
inset = 0.02,
legend = c("Insgesamt", "Deutsche", "Nichtdeutsche"), # Legend texts
lty = c(1, 1, 1), # Line types
pch = c(16, 17, 15),
col = c("orange1", "limegreen", "blue"), # Line colors
lwd = 2,
cex = 1.7)
dev.off()