我有一个问题geom_dl()
,它没有正确放置我的标签,因为两个组具有相同的标签。我知道
data$groups <- data$label
GeomDl 调用内部引起了麻烦,但我不知道如何解决它。
这是它目前的样子:
这就是它的样子:
这是数据和ggplot代码:
dat <- structure(list(level = structure(c(3L, 3L, 1L, 1L, 2L, 2L), .Label = c("2", "3", "1"), class = "factor"), year = c(2013L, 2014L, 2013L, 2014L, 2013L, 2014L), mean = c(9.86464372862218, 9.61027271206025, 18.3483708337732, 15.3459903281993, 6.75036415837688, 7.33169996044336), pchange = c(" 68%", " 68%", " 76%", " 76%", " 76%", " 76%")), .Names = c("level", "year", "mean", "pchange"), row.names = c(413L, 414L, 419L, 420L, 425L, 426L), class = "data.frame")
ggplot(dat, aes(x = year, y = mean)) +
geom_line(aes(color = level)) +
geom_dl(aes(label=pchange, color=level), method=list("last.qp"))