【发布时间】:2020-09-17 02:28:55
【问题描述】:
对于下面的数据框,如何在圆圈外显示带有箭头指向的标签?
asd <- data.frame(a=c("fs","dfg","gf"), b=c(3,5,6))
ggplot(asd, aes(x="", y= b, fill = factor(a))) +
geom_bar(stat = "identity", width =1) +
coord_polar(theta = "y") + theme_void() +
geom_text(aes(label=paste(a, sep = " ", b, "%"), x= 1.3, angle = 0))
【问题讨论】:
-
查看 ggrepel 包。