Color Palettes
Color is a very important factor for your visualization. Color can reveal patterns in data if used effectively or hide patterns if used poorly. Seaborn makes it easy to select and use color palettes that are suited to your task. The color_palette()
function provides an interface for many of the possible ways to generate color palettes.
The seaborn.color_palette([palette], [n_colors], [desat])
command returns a list of colors, thus defining a color palette.
The parameters are as follows:
palette
(optional): Name of palette orNone
to return the current palette.n_colors
(optional): Number of colors in the palette. If the specified number of colors is larger than the number of colors in the palette, the colors will be cycled.desat
(optional): The proportion to desaturate each color by.
You can set the palette for all plots with set_palette()
. This function accepts the same arguments as color_palette()
. In the following sections, we will explain...