我在数据中有一些要在绘图上注释的标签。我正在尝试使用directlabels
包进行注释。以下是我得到的:
library(directlabels)
ggplot(data =appr_CF_nlc %>% filter(SP_AB_Gp==7),
aes(x = frame_index, y = LV_frspacing.m, color = label, group=label)) + geom_line() +
geom_dl(aes(label = label), method = list(dl.trans(x = x+.2), "first.points"))
您会看到标签不完全可见。我怎样才能解决这个问题?我尝试使用scale_x_continuous
运气不好:
ggplot(data =appr_CF_nlc %>% filter(SP_AB_Gp==7),
aes(x = frame_index, y = LV_frspacing.m, color = label, group=label)) + geom_line() +
geom_dl(aes(label = label), method = list(dl.trans(x = x + 0.), "first.points")) +
scale_x_continuous(expand=c(0.5,0), limits=c(0, 3500))