add_areastack_absolute | R Documentation |
Add area stack
add_areastack_absolute(
plot,
linewidth = 0.25,
alpha = 0.4,
reverse = FALSE,
replace_na = FALSE,
...
)
add_areastack_relative(
plot,
linewidth = 0.25,
alpha = 0.4,
reverse = FALSE,
replace_na = FALSE,
...
)
plot |
A |
linewidth |
Thickness of the line in points (pt). Typical values range between |
alpha |
A |
reverse |
Whether the order should be reversed or not. Defaults to |
replace_na |
Whether to replace |
... |
Arguments passed on to the |
A tidyplot
object.
# for a `count` provide `x` and `color`
# `count` of the data points in each `energy_type` category
energy |>
tidyplot(x = year, color = energy_type) |>
add_areastack_absolute()
energy |>
tidyplot(x = year, color = energy_type) |>
add_areastack_relative()
# for a `sum` provide `x`, `y` and `color`
# `sum` of `energy` in each `energy_type` category
energy |>
tidyplot(x = year, y = energy, color = energy_type) |>
add_areastack_absolute()
energy |>
tidyplot(x = year, y = energy, color = energy_type) |>
add_areastack_relative()
# Flip x and y-axis
energy |>
tidyplot(x = energy, y = year, color = energy_type) |>
add_areastack_absolute(orientation = "y")
energy |>
tidyplot(x = energy, y = year, color = energy_type) |>
add_areastack_relative(orientation = "y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.