79829463

Date: 2025-11-25 08:57:32
Score: 3.5
Natty:
Report link
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))
...
Reasons:
  • Blacklisted phrase (0.5): thank you
  • Blacklisted phrase (3): Is there a solution
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Felix