position_fill

Stack overlapping objects on top of one another, and standardise have equal height

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="fill")


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


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


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


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


>