Hello Vinicius,
thank you so much for your efforts and support, it really helped! To make things unfortunately a bit more complicated: this plot is part of a patchwork plot with a total of 4 plots, 2 on top and 2 on the bottom. I’ve now set it so that the top and bottom plots each share the same Y-axis alignment, so that the positive and negative values start from the same position.
However, this has caused geom_text to be displayed incorrectly again. Is there a solution for this within the existing code?
# Patchwork Arrangement:
plot_oben <- p1 | p3
plot_unten <- p2 | p4
plot <- plot_oben / plot_unten
# shared Y-Axis:
# p_oben (p1 and p3)
max_oben <- max(
data_schule_schulform$Anzahl,
data_2_schule_schulform$Anzahl,
data_schule_jahrgang$Anzahl,
data_2_schule_jahrgang$Anzahl
)
# p_unten (p2 and p4)
max_unten <- max(
data_schulform_1$Anzahl,
data_schulform_2$Anzahl,
data_schulform_3$Anzahl,
data_schulform_4$Anzahl
)
Below each plot i added for example...
p1 <- p1 +
scale_y_continuous(limits = c(-max_oben, max_oben))
p2 <- p2 +
scale_y_continuous(limits = c(-max_unten, max_unten))
...