My goal is is to use a colormap that maps via a dict, a given number to a given color.
However, matplotlib seems to have normalized the number.
For example, I first created a custom colormap use seaborn, and feed it into plt.scatter
import seaborn as sns
colors = ['pumpkin', "bright sky blue", 'light green', 'salmon', 'grey', 'pale grey']
pal = sns.xkcd_palette(colors)
sns.palplot(pal)
from matplotlib import pyplot as plt
from matplotlib.colors import ListedColormap
cmap = ListedColormap(pal.as_hex())
x = [0, 1, 2]
y = [0, 1, 2]
plt.scatter(x, y, c=[0, 1, 2], s=500, cmap=cmap) # I'd like to get color ['pumpkin', "bright sky blue", 'light green']
but, it gives me color ['pumpkin', 'salmon', 'pale grey']
In short: colormap:
getting color 0, 1, and 2 (desired):
but matplotlib gives:





