samedi 23 juillet 2016

How do I use seaborns color_palette as a colormap in matplotlib?

Seaborn offers a function called color_palette, which allows you to easily create new color_palettes for plots.

colors = ["#67E568","#257F27","#08420D","#FFF000","#FFB62B","#E56124","#E53E30","#7F2353","#F911FF","#9F8CA6"]

color_palette = sns.color_palette(colors)

I want to transform color_palette to a cmap, which I can use in matplotlib, but I don't see how I can do this.

Sadly just functions like cubehelix_palette,light_palette,… have an as_cmap paramater. color_palette doesn't unfortunately.

Aucun commentaire:

Enregistrer un commentaire