RColorBrewer Palettes

Color Groups

RColorBrewer is an R packages that uses the work from http://colorbrewer2.org/ to help you choose sensible colour schemes for figures in R.  The colors are split into three group, sequential, diverging, and qualitative. 

  • Sequential – Light colours for low data, dark for high data
  • Diverging –  Light colours for mid-range data, low and high contrasting dark colours
  • Qualitative – Colours designed to give maximum visual difference between classes

The Palettes

Palettes from RColorBrewer can be displayed with the display.brewer.all() function.


R Commands

Palette and color count are selected using brewer.pal(n, name), where name is a character string.  The result is a set of hexadecimal codes.  Configuration can be confirmed by using display.brewer.pal(n, name).

ggplot Commands

The scale commands for ggplot are scale_fill_brewer() and scale_color_brewer().


Back | Next