Skip to content

Instantly share code, notes, and snippets.

@myracheng
myracheng / CBcolors.py
Last active May 26, 2021 17:42 — forked from thriveth/CBcolors.py
RGB A color blind/friendly color cycle for Matplotlib line plots. Might want to shuffle it around a bit more,but already not it gives kinda good contrasts between subsequent colors, and shows reasonably well in colorblind filters (though not in pure monochrome).
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
## convert to RGB for matplotlib
# import matplotlib.colors
# for i in CB_color_cycle:
# print(str(matplotlib.colors.to_rgb(i))+',')
CB_color_cycle = [(0.21568627450980393, 0.49411764705882355, 0.7215686274509804),