aesthetics
Parameters:
context : string or dictScaling parameters, see plotting_context() .
style : string or dictAxes style parameters, see axes_style() .
palette : string or sequenceColor palette, see color_palette() .
font : stringFont family, see matplotlib font manager.
font_scale : float, optionalSeparate scaling factor to independently scale the size of the
font elements.
color_codes : boolIf True and palette is a seaborn palette, remap the shorthand
color codes (e.g. “b”, “g”, “r”, etc.) to the colors from this palette.
rc : dict or NoneDictionary of rc parameter mappings to override the above.
Examples By default, seaborn plots will be made with the current values of the
matplotlib rcParams:
sns . barplot ( x = [ "A" , "B" , "C" ], y = [ 1 , 3 , 2 ])
Calling this function with no arguments will activate seaborn’s
“default” theme:
sns . set_theme ()
sns . barplot ( x = [ "A" , "B" , "C" ], y = [ 1 , 3 , 2 ])
Note that this will take effect for all matplotlib plots, including
those not made using seaborn:
plt . bar ([ "A" , "B" , "C" ], [ 1 , 3 , 2 ])
The seaborn theme is decomposed into several distinct sets of parameters
that you can control independently:
sns . set_theme ( style = "whitegrid" , palette = "pastel" )
sns . barplot ( x = [ "A" , "B" , "C" ], y = [ 1 , 3 , 2 ])
Pass None to preserve the current values for a given set of
parameters:
sns . set_theme ( style = "white" , palette = None )
sns . barplot ( x = [ "A" , "B" , "C" ], y = [ 1 , 3 , 2 ])
You can also override any seaborn parameters or define additional
parameters that are part of the matplotlib rc system but not included in
the seaborn themes:
custom_params = { "axes.spines.right" : False , "axes.spines.top" : False }
sns . set_theme ( style = "ticks" , rc = custom_params )
sns . barplot ( x = [ "A" , "B" , "C" ], y = [ 1 , 3 , 2 ])