所以我有这个代码:
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。但我的情节是这样的:
我查看了其他问题,但没有找到与此类似的内容。如果您认为有一个可以帮助我,或者如果您需要更多信息,请告诉我。谢谢!