-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
figrecipes should use palettable colors #232
Comments
I agree. The colormaps seem to be intended for matplotlib but it doesn't look like there is any reason they wouldn't work with Plotly ... crosses fingers |
Upon actually trying this, Paletteable and FigRecipes often really don't play nice together. Mostly because converting matplotlib color maps into Plotly-capable format doesn't work outside of the few examples Plotly provides. Perhaps we could choose one of the better Plotly colormaps to be the FigRecipes default? |
@albalu do we have an example of a custom (ie, non-Plotly) colorscale (a list) being used in figrecipes? |
No we always used one of the pre-defined ones. |
I think for this a good option here to define a utility function that, given a string representing a Palettable colormap, and a number n of colors to return, returns a list of n "equally spaced" hex colors. Then you can just plug that list into whatever plotlyfig args you want. If no colors are specified by the user, it uses a good default one. |
You might want to consult with @mkhorton , he is good with colors |
If you want n colors from a qualitative color map, you can do that in Palettable e.g. via:
It's tricky to get large palettes that are also color-blind safe however, e.g. see http://mkweb.bcgsc.ca/colorblind/ for some examples of 7 color palettes and 12 color palettes. I don't really think any plot with more than ~7 categorical/qualitative colors will ever look that great though.
This is easy enough in Palettable, the But this is just for qualitative/categorical colors. If you need a quantitative, just use viridis courtesy of BIDS :) |
Btw I sometimes use the app "Color Oracle" to get a sense of how a certain color scheme will work (or not work) for color blindness. I'd rate it as something to not prioritize for default color scheme but to have an option to use color blind safe colors Btw that web page @mkhorton sent out makes me wonder how many traffic accidents are caused by a poor color choice for traffic lights ... |
https://link.springer.com/chapter/10.1007/978-94-011-5408-6_54 xScope is a really nice app for simulating color blindness too, though I don't have a copy of the latest version sadly |
I think @utf did a good job of colors on the various codes like "sumo", etc. Might be worth it to just have a discussion w/him for the Figrecipes overall graphic design - colors, fonts, font sizes, etc. |
https://jiffyclub.github.io/palettable/
For example, pymatgen DOSPlotter uses this to set color libraries
See also seaborn color palettes:
http://seaborn.pydata.org/tutorial/color_palettes.html
The text was updated successfully, but these errors were encountered: