Fork me on GitHub

ggplot from ŷhat


scale_color_brewer

Usage

scale_color_brewer(type = 'seq', palette = 1)
scale_color_brewer(type = 'seq', palette = 'GnBu')

Arguments

Name Description
type Class of variable being used for color. Sequential (seq) | Qualitative (qual) | Diverging (div)
palette Color combination to use. Can be either an integer or the name of a palette. See http://colorbrewer2.org/ for more details.

Examples

ggplot(aes(x='carat', y='price', color='clarity'), data=diamonds) +\
    geom_point() +\
    scale_color_brewer(type='qual')
ggplot(aes(x='carat', y='price', color='clarity'), data=diamonds) + geom_point() + scale_color_brewer(type='seq', palette='Reds')
ggplot(aes(x='carat', y='price', color='clarity'), data=diamonds) + geom_point() + scale_color_brewer(type='div', palette=2)