def set_palette(palette, n_colors=None, desat=None, color_codes=False):
 colors = palettes.color_palette(palette, n_colors, desat)
 if mpl_ge_150:
  from cycler import cycler
  cyl = cycler('color', colors)
  mpl.rcParams['axes.prop_cycle'] = cyl
 else:
  mpl.rcParams['axes.color_cycle'] = list(colors)
 mpl.rcParams['patch.facecolor'] = colors[0]
 if color_codes:
  palettes.set_color_codes(palette)

def set_palette ( palette , n_colors = None , desat = None , color_codes = False ) : colors = palettes . color_palette ( palette , n_colors , desat ) if mpl_ge_150 : from cycler import cycler cyl = cycler ( 'color' , colors ) mpl . rcParams [ 'axes.prop_cycle' ] = cyl else : mpl . rcParams [ 'axes.color_cycle' ] = list ( colors ) mpl . rcParams [ 'patch.facecolor' ] = colors [ 0 ] if color_codes : palettes . set_color_codes ( palette )
set the matplotlib color cycle using a seaborn palette .