This package generates and plot palettes of optimally distinct colours in perceptually uniform colour space, based on iwanthue. This is done through k-means clustering of CIE Lab colour space, according to user-selected constraints on hue, chroma, and lightness.
iwanthue
palettes can be added directly onto ggplot2 objects via the function scale_colour_iwanthue
.
The current CRAN version of hues
can be installed with:
The development version of hues
can be installed using install_github
from the devtools
package:
# install.packages('devtools') # uncomment if devtools isn't already installed
devtools::install_github('johnbaums/hues')
The examples below show palettes corresponding to some presets given at the iwanthue website.
ggplot2
integrationlibrary(ggplot2)
ggplot(iris, aes(x=Petal.Width, y=Petal.Length)) +
geom_point(aes(color=Species), size=3) +
scale_colour_iwanthue()