%matplotlib inline
from ggplot import *
scale_color_gradient
¶scale_color_gradient
applies a color gradient to continuous color variables in your ggplots. Its parameters are:
low
- low end of the gradienthigh
- high end of the gradientpigeons.head()
ggplot(pigeons, aes(x='speed', y='pos', color='speed')) + \
geom_point() + \
scale_color_gradient()
ggplot(pigeons, aes(x='speed', y='pos', color='speed')) + \
geom_point() + \
scale_color_gradient(low='blue', high='red')
ggplot(pigeons, aes(x='speed', y='pos', color='speed')) + \
geom_point() + \
scale_color_gradient(low='FloralWhite', high='LemonChiffon')
ggplot(pigeons, aes(x='speed', y='pos', color='speed')) + \
geom_point() + \
scale_color_gradient(low='LawnGreen', high='DarkSalmon')