xxxxxxxxxx
seaborn.set_theme(context='notebook', style='darkgrid', palette='deep', font='sans-serif',
font_scale=1, color_codes=True, rc=None)
# Parameters
# contextstring or dict
# Scaling parameters, see plotting_context().
# stylestring or dict
# Axes style parameters, see axes_style().
# palettestring or sequence
# Color palette, see color_palette().
# fontstring
# Font family, see matplotlib font manager.
# font_scalefloat, optional
# Separate scaling factor to independently scale the size of the font elements.
# color_codesbool
# If True and palette is a seaborn palette, remap the shorthand color codes (e.g. “b”, “g”, “r”, etc.) to the colors from this palette.
# rcdict or None
# Dictionary of rc parameter mappings to override the above.
xxxxxxxxxx
# Set the Seaborn theme and color palette
sns.set_theme(style="whitegrid") # You can choose from different themes like "darkgrid", "whitegrid", "dark", "white", etc.
sns.set_palette("pastel") # You can choose from different palettes like "pastel", "deep", "muted", "colorblind", etc.
xxxxxxxxxx
import seaborn as sns
custom_palette = ['#FBB4AE', '#B3CDE3', '#CCEBC5','#DECBE4', '#FED9A6']
sns.set_theme(context='talk', # sns.set_context("talk")
style='whitegrid', # sns.set_style("whitegrid")
palette='RdBu', # sns.set_palette(custom_palette)
font='sans-serif',
font_scale=1,
color_codes=True,
rc=None)
# Show color palette
sns.palplot(sns.color_palette())
sns.palplot(sns.color_palette("BrBG", 12))