Adjusting geom_bar (position="dodge") in ggplot
You can customise the dodging by specifying position = position_dodge(...)
.
ggplot (df, aes(x=z, y=value, fill=variable)) +
geom_bar (stat="identity", position = position_dodge(width = 0.5))
I solved it with the help of above, but further adjustment:
ggplot(df, aes(x=z, y=value, fill=variable)) +
geom_bar(stat="identity", position = position_dodge2(width = 0.5, preserve = "single", padding = -0.5))