2017-10-08 70 views

回答

0

您可以使用vjust和hjust控制它。

尝试以下操作:

ggplot(data=df, aes(x=Demand_Supply,fill=time_slot),position = 'stack')+ geom_bar() + facet_wrap(~Pickup.point)+ 
geom_text(stat='count',aes(label=abs(..count..)), , vjust = -0.5) 

你可以尝试不同的排列组合与hjust和vjust。

+0

ggplot(data = df,aes(x = Demand_Supply,fill = time_slot),position ='stack')+ geom_bar()+ facet_wrap(〜'Pickup.point')+ geom_text(stat ='count', aes(label = abs(.. count ..)),size = 3,hjust = 0.5,position = position_stack(vjust = 0.5)) –

+0

它是正确的。 –

+0

@chandrapalpanwarplease接受它作为答案或upvote,如果它值得。 –