2016-04-28 12 views
1

これは非常に簡単な質問です! は、私はエラーバーでbarplotをしたいと思い、私は次のコードを使用しています:私は、Y = 0 2で開始するようにバーを希望 1:軸を調整するggplot(geom_bar)

ggplot(data = bars, aes(x=c("1","2","3"), y=V2, fill = names)) + 
    geom_bar(position=position_dodge(), stat="identity", alpha = 0.7) + 
    geom_errorbar(aes(ymin=V1, ymax=V3))+ 
    theme(legend.position='none')+ 
    coord_cartesian(ylim=c(0,10)) 

をしかし、私は2つの問題があります。私はy軸のティックが気に入らない。私は小数点以下1桁の数字だけを使用したいと思います。

これは私の実際のプロットである:あなたがylim

... + ylim(0.2, NA) 

NAが上限無料の葉使用できる最初の問題についてはBars with error bars

答えて

1

(私はそれを正しく理解している場合)。第二のために

、私はscale

library(scales) 
... + scale_y_continuous(breaks=pretty_breaks(n=5)) 
から pretty_breaksを使用することをお勧め
関連する問題