Description Usage Arguments Value Examples
Create a population pyramid plot. Traditionally, x-axis is gender and y-axis is age, so even though in this plot they both can have other names and values, we use "age" and "gender" for column names.
1 2 3 | pyramid_plot(dat, yticks = NULL, xtitle = "", ytitle = "",
yname = NULL, palette = c("tomato", "steelblue"),
plot_bgcolor = "#ECF0F5", paper_bgcolor = "#FCFCFC")
|
dat |
tibble with columns "age" and "gender". "gender" should be a factor with two levels (e.g. "Female" and "Male"). If not a factor, will be converted into a factor. Age can be numeric or character. |
yticks |
values to show on the yaxis |
xtitle |
x-axis title |
ytitle |
y-axis title |
yname |
name for the variable on y-axis, to show in the hoverplate. |
palette |
vector of two colors, for Female and Male (in that order). |
plot_bgcolor |
plot background color |
paper_bgcolor |
plot paper color |
plotly object
1 | #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.