In [1]:
%matplotlib inline
from ggplot import *
import pandas as pd

scale_color_identity

scale_color_identity applies the color values in your data to your ggplots.


In [2]:
ze_colors = [
    "blue",
    "red",
    "green",
    "MediumAquaMarine",
    "Peru",
    "Tomato",
    "#f8b195",
    "#ffb6c1",
    "#933835",
    "Bisque"
]
df = pd.DataFrame({
        "x": range(10),
        "y": range(10),
        "ze-color": ze_colors
    })
df


Out[2]:
x y ze-color
0 0 0 blue
1 1 1 red
2 2 2 green
3 3 3 MediumAquaMarine
4 4 4 Peru
5 5 5 Tomato
6 6 6 #f8b195
7 7 7 #ffb6c1
8 8 8 #933835
9 9 9 Bisque

In [3]:
ggplot(df, aes(x='x', y='y', color='ze-color')) + \
    geom_point(size=7500) + \
    scale_color_identity()


Out[3]:
<ggplot: (285108485)>

In [ ]: