Tutorial by Examples

Viridis (named after the chromis viridis fish) is a recently developed color scheme for the Python library matplotlib (the video presentation by the link explains how the color scheme was developed and what are its main advantages). It is seamlessly ported to R. There are 4 variants of color scheme...
ColorBrewer project is a very popular tool to select harmoniously matching color palettes. RColorBrewer is a port of the project for R and provides also colorblind-friendly palettes. An example of use colors_vec <- brewer.pal(5, name = 'BrBG') print(colors_vec) [1] "#A6611A" &quot...
Quite often there is a need to glimpse the chosen color palette. One elegant solution is the following self defined function: color_glimpse <- function(colors_string){ n <- length(colors_string) hist(1:n,breaks=0:n,col=colors_string) } An example of use color_glimpse(...
The package colorspace provides GUI for selecting a palette. On the call of choose_palette() function the following window pops-up: When the palette is chosen, just hit OK and do not forget to store the output in a variable, e.g. pal. pal <- choose_palette() The output is a function that t...
Function colors() lists all the color names that are recognized by R. There is a nice PDF where one can actually see those colors. colorRampPalette creates a function that interpolate a set of given colors to create new color palettes. This output function takes n (number) as input and produces a...
Even though colorblind people can recognize a wide range of colors, it might be hard to differentiate between certain colors. RColorBrewer provides colorblind-friendly palettes: library(RColorBrewer) display.brewer.all(colorblindFriendly = T) The Color Universal Design from the University ...

Page 1 of 1