Color palettes in ggpairs

A short description of the post.

Rodney Dyer (Center for Environmental Studies)

Working on some code and was having a tough time configuring the color palette in GGally since it does not produce a ggplot object. It appears to be a larger problem. So, here is one hack, redefine the ggplot function and change the default palette there. Need to make a dyerlab::palette now…

ggplot <- function(...) ggplot2::ggplot(...) + scale_color_brewer(palette="Set1")
ggpairs(df,columns = 3:7,axisLabels="none",color="color")


For attribution, please cite this work as

Dyer (2015, March 26). The Dyer Laboratory: Color palettes in ggpairs. Retrieved from

BibTeX citation

  author = {Dyer, Rodney},
  title = {The Dyer Laboratory: Color palettes in ggpairs},
  url = {},
  year = {2015}