feat: added option to choose color palettes for all available plots. this includes a custom function to generate colors from several palettes as well as a select function to include color previews.

This commit is contained in:
Andreas Gammelgaard Damsbo 2026-03-24 12:04:54 +01:00
commit 6c850847b7
No known key found for this signature in database
21 changed files with 1110 additions and 251 deletions

View file

@ -7,7 +7,8 @@
#'
#' @examples
#' mtcars |> plot_scatter(pri = "mpg", sec = "wt")
plot_scatter <- function(data, pri, sec, ter = NULL) {
#' mtcars |> plot_scatter(pri = "mpg", sec = "wt",ter="carb")
plot_scatter <- function(data, pri, sec, ter = NULL, color.palette="viridis") {
if (is.null(ter)) {
rempsyc::nice_scatter(
data = data,
@ -24,6 +25,7 @@ plot_scatter <- function(data, pri, sec, ter = NULL) {
group = ter,
xtitle = get_label(data, var = sec),
ytitle = get_label(data, var = pri)
)
)+
scale_color_generate(palette=color.palette)
}
}