Home > Back-end >  Can I create sns color palettes?
Can I create sns color palettes?

Time:10-02

I'm using these seaborn palettes

sns.color_palette('light:b')

I get from light to blue like this.

enter image description here

If I go 'dark:b', it goes from dark to blue.

Can I go something like this 'dark:b:light, from dark to blue, from blue to light, to custom every color I use (red, green, blue, purple and other)?

CodePudding user response:

Seaborn contains a lot of function to create color palettes and color maps. An introuction can be found at the blend:red,green,blue,purple

So, the answer to your question is "yes, you can create color palettes". E.g. sns.color_palette('blend:0.1,blue,0.9', as_cmap=True) would go from dark over blue to light. (Note that a string with a number between 0 and 1 represents a gray value when interpreted as a color in matplotlib.)

dark over blue to light

  • Related