Sets a global colour palette used by all plotting functions in phenoscapR. The palette can be a viridis option, a custom gradient defined by 2-3 anchor colours, or a named vector of discrete colours.
Arguments
- palette
Character or named character vector. Either:
A viridis palette name:
"viridis","magma","inferno","plasma","cividis","rocket","mako","turbo".A character vector of 2-3 hex colours for a custom gradient (e.g.
c("#440154", "#21918c", "#fde725")).NULLto return the current palette without changing it.
Examples
SetPalette("magma")
GetPalette()
#> [1] "magma"
# Custom 3-colour gradient
SetPalette(c("navy", "white", "firebrick"))
GetPalette()
#> [1] "navy" "white" "firebrick"
# Reset to default
SetPalette("viridis")