Back to Seaborn

Color Palette

doc/_docstrings/color_palette.ipynb

0.13.2999 B
Original Source
python
import seaborn as sns
sns.set_theme()
sns.palettes._patch_colormap_display()
python
sns.color_palette()
python
sns.color_palette("pastel")
python
sns.color_palette("husl", 9)
python
sns.color_palette("Set2")
python
sns.color_palette("Spectral", as_cmap=True)
python
sns.color_palette("flare")
python
sns.color_palette("flare", as_cmap=True)
python
sns.color_palette("ch:s=.25,rot=-.25", as_cmap=True)
python
sns.color_palette("light:#5A9", as_cmap=True)
python
sns.color_palette("dark:#5A9_r", as_cmap=True)
python
sns.color_palette("blend:#7AB,#EDA", as_cmap=True)
python
x, y = list(range(10)), [0] * 10
hue = list(map(str, x))
python
with sns.color_palette("Set3"):
    sns.relplot(x=x, y=y, hue=hue, s=500, legend=False, height=1.3, aspect=4)

sns.relplot(x=x, y=y, hue=hue, s=500, legend=False, height=1.3, aspect=4)
python
print(sns.color_palette("pastel6").as_hex())