Skip to content

Instantly share code, notes, and snippets.

@DominikVogel
Created September 27, 2021 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikVogel/14fff4fdb8fccfa9c238e06708cefefc to your computer and use it in GitHub Desktop.
Save DominikVogel/14fff4fdb8fccfa9c238e06708cefefc to your computer and use it in GitHub Desktop.
Projektion zur Entwicklung der Größe des Bundestags
library(tidyverse)
func <- function(x){4.25*x*x + 20.45*x + 591.25}
ggplot(data.frame(x=c(1, 22)), aes(x=x)) +
stat_function(fun=func, size = 1.5) +
geom_hline(yintercept = 2980, color = "red", size = 2) +
scale_x_continuous(name = "Jahr",
breaks = c(1:22),
labels = c("2009",
"2013",
"2017",
"2021",
"2025",
"2029",
"2033",
"2037",
"2041",
"2045",
"2049",
"2053",
"2057",
"2061",
"2065",
"2069",
"2073",
"2077",
"2081",
"2085",
"2089",
"2093")) +
scale_y_continuous(name = "Anzahl Abgeordnete",
limits = c(0, 3100),
breaks = seq.int(0, 3000, 500)) +
cowplot::theme_cowplot() +
geom_point(aes(y=622, x=1), color="red", size=2.5) +
geom_point(aes(y=631, x=2), color="red", size=2.5) +
geom_point(aes(y=709, x=3), color="red", size=2.5) +
geom_point(aes(y=735, x=4), color="red", size=2.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment