3
我有興趣生成位置='dodge'和fill =一些因子的直方圖(即每個條形圖/組中不同子組的並排條形圖),但ggplot2給了我一些像the first plot here,它有一個最右邊的酒吧,太寬,並保留沒有空的空組,我想。ggplot2 position ='dodge'產生太寬的條紋
這裏有一個簡單的例子:
df = data.frame(a=c('o','x','o','o'), b=c('a','b','a','b'))
qplot(a, data=df, fill=b, position='dodge')
從ggplot geom_bar - bars too wide我有這個想法,而它在技術上產生相同寬度的條,但保留爲空組沒有空間:
ggplot(df, aes(x=a, fill=a))+
geom_bar(aes(y=..count../sum(..count..))) +
facet_grid(~b,scales="free",space="free")
我如何實現我想要的?提前致謝。