ggplot2标签隐藏在条形图背后

时间:2017-04-17 11:06:08

标签: r ggplot2 ggrepel

所以我有这段代码:

ggplot(aes(x=Year,y=Household.Expenditure.Total,
             fill=Household.Expenditure.on.Tobacco,
             label=Expenditure.on.Tobacco.as.a.Percentage.of.Expenditure))+
  theme_classic()+
  geom_text_repel()+
  geom_col()+
  scale_x_continuous(breaks=seq(1985,2015,by=5))+
  labs(x="Year",
       y="Household expenditure on tobacco and Household expenditure total",
       title="The comparison of Household expenditure on tobacco \nand 
Household expenditure total over years ",
       caption="data form kaggle")+
  theme(legend.position="bottom", plot.title = element_text(hjust = 0.5,vjust = 1))

请记住我已经安装并运行了ggrepel。但我的情节看起来像这样:

All the labels are hidden behind the graph

我看过其他问题,但没有找到类似的东西。如果你认为有一个可以帮助我,或者如果你需要更多信息,请告诉我。谢谢!

0 个答案:

没有答案