Learn Before
Idea

Color in Seaborn

The color in seaborn is fantastic. It supports personalized color configurations. There are many methods for color, two of them are:

  • sns.color_palette(): an interface that sets colors based on the RGB principle. It accepts a palette object as a parameter, and can set the number of colors.

  • sns.hls_palette(): set based on the principles of Hue, Luminance and Saturation, as its name HLS refers to. It provides evenly spaced colors.

When using these functions directly, it returns the RGB numbers for each color. For example, (0.30, 0.45, 0.70), each is within 0 and 1. To show the color, we can use sns.palplot().

Image 0

0

1

Updated 2021-02-05

Tags

Data Science