Plots male (negative, left) and female (positive, right) population
counts by age group as horizontal bars, animated over Year. Male values
are negated internally so the two sexes render back-to-back, while
display_value keeps the original (positive) counts for hover/axis text.
Usage
plot_pyramid(mfi_population, country, font_style)
Arguments
- mfi_population
Data frame of population-by-age/sex values (long
format, with Country Name, sex, age, Year, value columns).
- country
Character. Country name to plot.
- font_style
A plotly font list (e.g. list(size = 20, color = "gray25")) applied to the chart's layout.
Value
A plotly htmlwidget.
Examples
plot_pyramid(mfi_population, country = "Greece", font_style = font_style)