-1
ggplot(ab,aes(x=pk,y=Total,fill=Observation_Type)) +
geom_bar(stat="identity", position="stack") +
theme(axis.title.y=element_blank(),axis.text.y=element_blank()) +
coord_flip() +
geom_text(stat="identity",aes(label=Total, color=Observation_Type))
文本(這只是觀察的總數)顯得非常混亂。例如觀察類型1首先被繪製,但在標記觀察2首先顯示。R堆積的條形圖中的GGplot標籤
是否有可能:
- 改變顏色
- 使標籤在正確的位置
你能分享你的data.frame的幾行? – aelwan