1 min read

Change colors in ggplot2

The RColorBrewer package contains a wide range of color palettes to choose from.

A quick reference can be found here.

For example:

  • brewer.pal(n. "Set1")

where 3 is the minimum value for n.

See here for an example applying brewer.pal() from within scale_fill_manual() in ggplot2.