# NOT RUN {
df <- data.frame(
x = c(1,3,2,5,4,2.5),
y = c(2, 1, 2.5, 1.8, 2.8, 1.5),
label = c("abc","cd","d","c","bcd","a")
)
ggplot(df, aes(x, y, label = label)) +
geom_point() +
geom_text(position = position_nudge_to(y = 3)
)
ggplot(df, aes(x, y, label = label)) +
geom_point() +
geom_linked_text(position = position_nudge_to(y = 3),
vjust = -0.2)
# }
Run the code above in your browser using DataLab