Qualitative
A qualitative palette is used when the variable is categorical in nature, the color assigned to each group need to be distinct. Each possible value of the variable is assigned one color from a qualitative palette within a plot as shown in figure.
Example:
Python3
from matplotlib import pyplot as plt import seaborn as sns current_palette = sns.color_palette() sns.palplot(current_palette) plt.show() |
Output:
Seaborn – Color Palette
In this article, We are going to see seaborn color_palette(), which can be used for coloring the plot. Using the palette we can generate the point with different colors. In this below example we can see the palette can be responsible for generating the different colormap values.
Syntax: seaborn.color_palette(palette=None, n_colors=None, desat=None)
Parameters:
- palette: Name of palette or None to return current palette.
- n_colors: Number of colors in the palette.
- desat: Proportion to desaturate each color.
Returns: list of RGB tuples or matplotlib.colors.Colormap
We will classify the different ways for using color_palette() types −
- Qualitative
- Sequential
- Diverging
Contact Us