Population Pyramids with 'ggplot2'

Build population pyramids, the back-to-back bar charts of a population by age group and sex, as layers of a 'ggplot2' plot. A position adjustment mirrors one side and stacks subgroups within each side, so bars, labels and lines from any layer land on the correct side while the plot can still be faceted, themed and extended as usual. A coordinate system labels both sides with absolute values, gives them one shared scale, and places the age axis on either side or in a gap at the centre. Further layers count individual records or sum aggregated values, show proportions, label the bars, and draw a second population as a stepped outline for comparison.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ggpyramid")

0.1.0 by Matan Hakim, 5 hours ago


https://github.com/matanhakim/ggpyramid, https://matanhakim.github.io/ggpyramid/


Report a bug at https://github.com/matanhakim/ggpyramid/issues


Browse source code at https://github.com/cran/ggpyramid


Authors: Matan Hakim [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, ggplot2, rlang, scales, stats, utils, vctrs

Suggests knitr, rmarkdown, testthat, vdiffr


See at CRAN