def setupPalette(count, pal=None):
# See http://xkcd.com/color/rgb/. These were chosen to be different "enough".
colors = ['grass green', 'canary yellow', 'dirty pink', 'azure', 'tangerine', 'strawberry',
'yellowish green', 'gold', 'sea blue', 'lavender', 'orange brown', 'turquoise',
'royal blue', 'cranberry', 'pea green', 'vermillion', 'sandy yellow', 'greyish brown',
'magenta', 'silver', 'ivory', 'carolina blue', 'very light brown']
palette = sns.color_palette(palette=pal, n_colors=count) if pal else sns.xkcd_palette(colors)
sns.set_palette(palette, n_colors=count)
# For publications, call setupPlot("paper", font_scale=1.5)