- Seaborn Tutorial
- Seaborn - Home
- Seaborn - Introduction
- Seaborn - Environment Setup
- Importing Datasets and Libraries
- Seaborn - Figure Aesthetic
- Seaborn- Color Palette
- Seaborn - Histogram
- Seaborn - Kernel Density Estimates
- Visualizing Pairwise Relationship
- Seaborn - Plotting Categorical Data
- Distribution of Observations
- Seaborn - Statistical Estimation
- Seaborn - Plotting Wide Form Data
- Multi Panel Categorical Plots
- Seaborn - Linear Relationships
- Seaborn - Facet Grid
- Seaborn - Pair Grid
- Function Reference
- Seaborn - Function Reference
- Seaborn Useful Resources
- Seaborn - Quick Guide
- Seaborn - Useful Resources
- Seaborn - Discussion
Seaborn.saturate() method
Saturation of a color is defined by the strength of the light and how uniformly it is dispersed over the wavelength spectrum. When only one wavelength is used at extreme intensity, as in laser light, the purest color is produced. The saturation decreases as the intensity decreases.
The Seaborn.saturate() method is used to saturate a color and then this saturated color is returned.
Syntax
Following is the syntax of the seaborn.saturate() method −
seaborn.saturate(color)
Parameters
The parameters of this seaborn.saturate() method are given below.
S.No | Parameter and Description |
---|---|
1 | color This parameter takes matplotlib color as input and the values include hex, rgb-tuple or an html color name. |
Return Value
The return value of this method is an rgb-tuple which contains the saturated color of the color passed.
Example 1
Now we will see how the method works by passing a color to it.
sns.saturate("pink")
Output
The output produced is as follows. An rgb tuple of the color after saturation is given as output.
(1.0, 0.7529411764705882, 0.7960784313725489)
Example 2
In this example we will saturate another color and obtain the saturated color. We can use the palplot method to visualize the rgb tuples sent by the saturate method.
The following line of code can be used to do so.
import seaborn as sns import matplotlib.pyplot as plt sns.palplot(sns.saturate("blue")) plt.show()
Output
The output is as follows,
Example 3
We will use the palplot method to visualize a color saturated using the saturate method.
The below line of code can be used to do so.
import seaborn as sns import matplotlib.pyplot as plt sns.palplot(sns.saturate("yellow")) plt.show()
Output
The output is as follows −
To Continue Learning Please Login
Login with Google