Jak pokazać directlabels po geom_smooth, a nie po geom_line?
Używam directlabels do opisywania mojej fabuły. Jak widać na tym zdjęciu, etykiety są po geom_line, ale chcę je po geom_smooth. Czy jest to obsługiwane przez directlabels? Lub inne pomysły, jak to osiągnąć? Z góry dziękuję!
To jest mój kod:
<code>library("ggplot2") set.seed(124234345) # Generate data df.2 <- data.frame("n_gram" = c("word1"), "year" = rep(100:199), "match_count" = runif(100 ,min = 1000 , max = 2000)) df.2 <- rbind(df.2, data.frame("n_gram" = c("word2"), "year" = rep(100:199), "match_count" = runif(100 ,min = 1000 , max = 2000)) ) # plot ggplot(df.2, aes(year, match_count, group=n_gram, color=n_gram)) + geom_line(alpha = I(7/10), color="grey", show_guide=F) + stat_smooth(size=2, span=0.3, se=F, show_guide=F) + geom_dl(aes(label=n_gram), method = "last.bumpup", show_guide=F) + xlim(c(100,220)) </code>