标签在ggplot2条形图上被切割

时间:2016-07-18 12:40:48

标签: r ggplot2 label geom-bar

我创建了一个ggplot2条形图,并在条形图上方添加了条形y值的标签。

d <- data.frame(
       Ano=2000+5*0:10,
       Populacao =c(6.1,6.5,6.9,7.3,7.7,8.0,8.3,8.6,8.9,9.1,9.3)
     )
d %>% ggplot(aes(x=Ano, y=Populacao)) + geom_bar(stat="identity") +
  geom_text(aes(label=Populacao), vjust=-0.5) 

enter image description here

注意最高列上的标签是如何被剪切的。

图表是否有办法自动调整标签的存在?

编辑:我知道我可以使用scale_y_continuous(breaks=seq(0, 10, 1), limits=c(0,10))

手动调整此项

0 个答案:

没有答案
相关问题