Created
December 7, 2022 18:11
-
-
Save mschnetzer/c1bb4dadc047830fcb133aba18404c7a to your computer and use it in GitHub Desktop.
Erwerbsverläufe von Männern und Frauen mit Kindern (https://twitter.com/matschnetzer/status/1600058999306690560)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(waffle) | |
library(msthemes) | |
library(MetBrewer) | |
library(showtext) | |
df <- tribble( | |
~Geschlecht, ~Status, ~"<1", ~"1", ~"2", ~"3-5", ~"6-9", ~"10-14", | |
"Männer", "Vollzeit", 84.4, 83.2, 82.5, 83.7, 85.2, 83.5, | |
"Frauen", "Vollzeit", 8.6, 6, 11.9, 16.4, 20.1, 30.7, | |
"Männer", "Teilzeit", 7.7, 8.7, 8.2, 7.3, 4.6, 6.3, | |
"Frauen", "Teilzeit", 11, 27.4, 50.7, 60.3, 60, 52.2, | |
"Männer", "Karenz", 1, 1, 0, 0, 0, 0, | |
"Frauen", "Karenz", 45.3, 30.5, 3.2, 0, 0, 0, | |
"Männer", "Nicht erwerbstätig", 7.1, 7.1, 9.1, 9.0, 10.1, 10.2, | |
"Frauen", "Nicht erwerbstätig", 35.1, 36.1, 34.1, 23.3, 19.8, 17.2 | |
) | |
plotdf <- df |> | |
pivot_longer(-c(Geschlecht, Status), names_to = "Alter", values_to = "Wert") |> | |
mutate(Alter = factor(Alter, levels=c("<1", "1", "2", "3-5", "6-9", "10-14")), | |
Status = factor(Status, levels=c("Nicht erwerbstätig","Karenz","Teilzeit","Vollzeit"))) | |
plotdf |> ggplot(aes(x=Alter, y=Wert, fill=Status, group=Status)) + | |
geom_area() + | |
facet_wrap(~Geschlecht, strip.position = "top", dir = "h", scales = "fixed") + | |
scale_fill_manual(name = NULL, values = met.brewer("Lakota"), | |
guide = guide_legend(keywidth = 0.5)) + | |
theme_ms(grid=F,alttf=T) + | |
theme(axis.text.y = element_blank(), | |
plot.title = element_text(family = "Charter"), | |
plot.title.position = "panel", | |
plot.subtitle = element_text(family = "Charter", | |
margin = margin(t=7, b=10, unit="pt")), | |
legend.text = element_text(family = "Futura"), | |
strip.text = element_text(hjust = 0.5, family = "Futura"), | |
axis.text.x = element_text(size = 9, family = "Futura", | |
margin = margin(t=-3, unit = "pt")), | |
plot.caption.position = "plot", | |
axis.title.x = element_text(hjust = 0.05, size = 12, family = "Futura", | |
margin = margin(t=7, unit = "pt"))) + | |
labs( | |
y="", | |
x="Alter des Kindes", | |
title = "Vereinbarkeit von Familie und Beruf?", | |
subtitle = "Erwerbsstatus von Frauen und Männern nach Alter des jüngsten Kindes", | |
caption="Daten: Mikrozensus 2021, Statistik Austria. Grafik: @matschnetzer" | |
) | |
ggsave("careage.png", dpi=320, width = 8, height = 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment