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.

Plot126b

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().

Plot127

Back | Next

Leave a Reply

Your email address will not be published. Required fields are marked *

one + 9 =