I’m using ggrepel::geom_label_repel and trying to get the end segment line to attach to the same left aligned location on the label boxes. I have a dataset with varying clustering scales and can’t get a clean look. A similar question was asked here, but it was never answered.
This example shows the clean, left aligned appearance I’m aiming for:
ggplot(data = data.frame(x = abs(rnorm(10)),y=abs(rnorm(10)),lab = c(1:10)))+
ggrepel::geom_label_repel(aes(x=x,y=y,label = lab),
xlim = c(1.9,2),direction='y')+
geom_point(aes(x=x,y=y))+
xlim(c(0,2))
This example replicates data similar to mine:
ggplot(data = data.frame(x = c(abs(rnorm(10)),1),y=c(abs(rnorm(10)),10),lab = c(1:11)))+
ggrepel::geom_label_repel(aes(x=x,y=y,label = lab),
xlim = c(1.9,2),direction='y')+
geom_point(aes(x=x,y=y))+
xlim(c(0,2))
2