R: Graphical User Interface for Choosing HCL Color Palettes
choose_palette
R Documentation
Graphical User Interface for Choosing HCL Color Palettes
Description
A graphical user interface (GUI) for viewing, manipulating,
and choosing HCL color palettes.
Usage
choose_palette(pal = diverge_hcl, n = 7L, parent = NULL)
Arguments
pal
function; the initial palette, see ‘Value’ below.
n
integer; the initial number of colors in the palette.
parent
tkwin; the GUI parent window.
Details
Computes palettes based on the HCL (hue-chroma-luminance) color
model (as implemented by polarLUV). The GUI interfaces
the palette functions
rainbow_hcl for qualitative palettes,
sequential_hcl for sequential palettes with a single hue,
heat_hcl for sequential palettes with multiple hues, and
diverge_hcl for diverging palettes (composed from two single-hue
sequential palettes).
The GUI allows for interactive modification of the arguments of the respective
palette-generating functions, i.e.,
starting/ending hue (wavelength, type of color),
minimal/maximal chroma (colorfulness),
minimal maximal luminance (brightness, amount of gray), and
a power transformations that control how quickly/slowly chroma and/or
luminance are changed through the palette. Subsets of the parameters
may not be applicable depending on the type of palette chosen. See
rainbow_hcl and Zeileis et al. (2009) for a more detailed
explanation of the different arguments
Optionally, active palette can be illustrated by using a range of examples
such as a map, heatmap, scatter plot, perspective 3D surface etc.
To demonstrate different types of deficiencies, the active palette may
be desaturated (emulating printing on a grayscale printer) and, if the
dichromat package is available, collapsed to
emulate different types of color-blindness (without red-green or green-blue
contrasts).
Value
Returns a palette-generating function with the selected arguments.
Thus, the returned function takes an integer argument and returns the corresponding
number of HCL colors by traversing HCL space through interpolation
of the specified hue/chroma/luminance/power values.
Author(s)
Jason C. Fisher and Achim Zeileis
References
Zeileis A., Hornik K. and Murrell P. (2009),
Escaping RGBland: Selecting Colors for Statistical Graphics.
Computational Statistics & Data Analysis, 53, 3259-3270.
doi:10.1016/j.csda.2008.11.033
Preprint available from http://eeecon.uibk.ac.at/~zeileis/papers/Zeileis+Hornik+Murrell-2009.pdf.
See Also
rainbow_hcl
Examples
if(interactive()) {
pal <- choose_palette()
filled.contour(volcano, color.palette = pal, asp = 1)
}