bi_pal {biscale} | R Documentation |
Preview Palettes and Hex Values
Description
Prints either a visual preview of each palette or the associated hex values.
Usage
bi_pal(pal, dim = 3, preview = TRUE, flip_axes = FALSE, rotate_pal = FALSE)
Arguments
pal |
A palette name or a vector containing a custom palette.
If you are providing a palette name, it must be one of:
Pairs of palettes, such as If you are providing a custom palette, it must follow the formatting described in the 'Advanced Options' vignette. |
dim |
The dimensions of the palette. To use the built-in palettes,
this value must be either If you are using a custom palette, this value may be larger (though these
maps can be very hard to interpret). See the 'Advanced Options' vignette
for details on the relationship between |
preview |
A logical scalar; if |
flip_axes |
A logical scalar; if |
rotate_pal |
A logical scalar; if |
Details
The "Brown"
, "DkBlue"
, "DkCyan"
, and "GrPink"
palettes were made by
Joshua Stevens.
The "DkViolet"
palette was made by
Timo Grossenbacher and Angelo Zehr.
Many of the new palettes were inspired by Branson Fox's earlier work to expand
biscale
.
Value
If preview = TRUE
, an image preview of the legend will be returned.
Otherwise, if preview = FALSE
, a named vector with class values for names
and their corresponding hex color values.
Examples
# gray pink palette, 2x2
bi_pal(pal = "GrPink", dim = 2)
# gray pink palette, 2x2 hex values
bi_pal(pal = "GrPink", dim = 2, preview = FALSE)
# gray pink palette, 3x3
bi_pal(pal = "GrPink", dim = 3)
# gray pink palette, 3x3 hex values
bi_pal(pal = "GrPink", dim = 3, preview = FALSE)
# custom palette
custom_pal <- c(
"1-1" = "#cabed0", # low x, low y
"2-1" = "#ae3a4e", # high x, low y
"1-2" = "#4885c1", # low x, high y
"2-2" = "#3f2949" # high x, high y
)
bi_pal(pal = custom_pal, dim = 2, preview = FALSE)