Once points in a geom_violin
are distributed via geom_sina
and then labelled via geom_label_repel
or even geom_label
, the line points to the midline of the x-axis category.
Is there a way to have geom_label_repel
or even geom_label
know where the point is after geom_sina
?
Example:
library(dplyr)
library(ggforce)
library(ggplot2)
library(ggrepel)
ggplot(midwest, aes(state, area)) +
geom_violin() +
geom_sina() +
geom_label_repel(box.padding = 0.5, min.segment.length = 0.5, aes(label = county), data=midwest %>% subset(poptotal>1000000), size=3)
You can see how the line from the label always goes to the midline, but not the point (see WAYNE and OAKLAND county in MI).