Changing bar width when using stat_summary with ggplot
This is the subject of a known issues 444 and 235
The current solution is to pass width
within aes
-- this goes against the principles of ggplot
(mapping vs setting), but at least it works....
Note that you can use linerange
if you want the error bars without erro bars!
ggplot(data, aes(group, y)) +
stat_summary(fun.y="mean", geom="bar", aes(width=0.5)) +
stat_summary(fun.data="mean_cl_normal", geom="linerange", size=2)
This issue has been resolved. width
now also works with stat_summary
and geom="errorbar"
.