我尝试用多维度的ggplot制作条形图。然后我想得到条形图的总和恰好在每个条形图的中间,但是它们堆叠在彼此之上。有什么建议吗?
b<-as.data.table(aggregate(betrerg ~ Region+GK2, na.data2, mean))
b$betrerg<-round(b$betrerg,-3)
ggplot(b, aes(y=betrerg,x=GK2,label=b$betrerg)) + geom_bar(aes(fill=Region),position = "dodge",stat = "identity")
+ggtitle("Verteilung der organisationsform pro Kanton (Kooperationsform)")+labs(x=NULL, y="Anzahl")+theme(axis.text.x = element_text(angle = -50, hjust = 0))
+geom_text(aes(label=(b$betrerg/1000)),size=2, position = position_dodge(0.9), vjust = -0.2)
在exel中很容易做到
多维条形图
期望的结果,来自exel