Fork me on GitHub

ggplot from ŷhat


scale_color_gradient2

Usage

scale_color_gradient2(low = 'red', high = 'blue')

Arguments

Name Description
low Color for low end of gradient.
high Color for high end of gradient.

Examples

dsub = diamonds[(diamonds.x > 5) & (diamonds.x < 7.5)]
ggplot(aes(x='x', y='y', color='abs(x - y)'), data=dsub) + \
    geom_point() + \
    scale_color_gradient2()
p = ggplot(aes(x='x', y='y', color='abs(x - y)'), data=dsub.head(1000)) + \
    geom_point() + \
    scale_colour_gradient2(low="steelblue", high="black")
ggplot(aes(x='x', y='y', color='abs(x - y)'), data=dsub.head(1000)) + \
    geom_point() + \
    scale_colour_gradient2(low="yellow", high="red")