Parameters to add and customize shadeareas in roboplots.
Arguments
- xmin, xmax
Currently not validated. These need to be of the same type as the respective axis for the shade area to work.
- border, color
Characters. The color for the shade area. Must be a hexadecimal color or a valid css color.
- opacity
Numeric. Controls the opacity of the shade area. Use a value between 0 and 1.
- layer
Character. Whether the shade area is above or below the plot traces. Use "above" or "below".
Examples
# You can use` shadearea` when the x-axis is numeric or date to highlight areas
# of the plot.
d <- energiantuonti |>
dplyr::filter(Alue == "Venäjä")
d |> roboplot(Suunta, shadearea = set_shadearea(xmin = "2018-01-01"))
# Use the other parameters to fine-tune the appearance of the `shadearea`.
d |> roboplot(
Suunta,
shadearea = set_shadearea(
xmin = "2018-01-01",
color = "green",
border = "black",
opacity = 0.8,
layer = "below"
)
)