position_dodge

Adjust position by 'dodging' overlaps to the side

Details

See layer and qplot for more information on creating a complete plot from multiple components.

Examples


> ggplot(mtcars, aes(x=factor(cyl), fill=factor(vs))) + geom_bar(position="dodge")


> ggplot(diamonds, aes(x=price, fill=cut)) + geom_bar(position="dodge")


> # see ?geom_boxplot and ?geom_bar for more examples