Created
January 22, 2014 14:52
-
-
Save thriveth/8560036 to your computer and use it in GitHub Desktop.
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a', | |
'#f781bf', '#a65628', '#984ea3', | |
'#999999', '#e41a1c', '#dede00'] |
Funny enough: matplotlib has already implemented the category10 color as a standard mode in version 2.0.
however if you do something like this:
matplotlib.pyplot.plot(x,y, color = 'blue')
the old basic color will be used. So beware. New notation of category10 is as shown here:
matplotlib.pyplot.plot(x,y, color = 'C0')
Just for the sake of completeness in case someone stumbles over this old question like I did today.
Thanks for your answer @swharden , without it I wouldn't know category10 colors.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that this list describes "category-10"
... and there is a related list with 20 unique colors