%matplotlib inline
from ggplot import *
scale_color_maual
¶scale_color_manual
applies color values to discrete color variables in your ggplots. It has 1 parameter:
values
- colors you'd like to useggplot(mtcars, aes(x='wt', y='mpg', color='factor(cyl)')) + \
geom_point() + \
scale_color_manual(values=['blue', 'green', 'purple'])
ggplot(mtcars, aes(x='wt', y='mpg', color='factor(cyl)')) + \
geom_point() + \
scale_color_manual(values=['MediumSeaGreen', 'MediumSlateBlue', 'MediumAquaMarine'])
ggplot(mtcars, aes(x='wt', y='mpg', color='factor(cyl)')) + \
geom_point() + \
scale_color_manual(values=['#ff0000', '#ff8000', '#ffbf00'])