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

Color blind-friendly default color cycle #9460

Open
mpetroff opened this Issue Oct 17, 2017 · 13 comments

Comments

Projects
None yet
8 participants
@mpetroff

mpetroff commented Oct 17, 2017

The default tab10 qualitative colormap is not color blind friendly, at least with my form of color blindness; I have difficulty telling the second and third colors apart. It would be nice to have a new default qualitative colormap that is color blind friendly, since it's the most commonly used. As Matplotlib 2 is finding increased adoption, I'm often coming across plots that I have difficulty reading due to the default colormap.

I find the perceptually uniform sequential colormaps quite nice, since I can actually read them. It's unfortunate that the same isn't true of the qualitative colormaps. The new Tableau 10 colormap is much better in this regard, but I'm guessing that there are intellectual property concerns that would bar including it.

@jklymak

This comment has been minimized.

Contributor

jklymak commented Oct 17, 2017

@mpetroff did you happen to see #9255? I don't know that it'll be made the default, but may help address your concerns...

@WeatherGod

This comment has been minimized.

Member

WeatherGod commented Oct 17, 2017

@afvincent

This comment has been minimized.

Contributor

afvincent commented Oct 17, 2017

I think that @mpetroff's point (please correct me if I am wrong) was more that having a not-so-great default (qualitative) color cycle makes a significant number of the plots made with Matplotlib 2 difficult to read for quite a lot of people (including him), as I guess most of the end-users simply rely on the default color cycle. From my own experience, I have to admit that even for non colorblind people, (at least) the first colors of the new default cycle are sometimes difficult to distinguish when printed out in grayscale...

Unfortunately, I guess that changing again the default color cycle is not a plausible option before Matplotlib 3 :/ and that the best we can currently do is indeed to provide nice colorblind-friendly color cycles (like #9255), possibly with more “advertising” about them in the relevant part of the documentation.

Edit: English...

@WeatherGod

This comment has been minimized.

Member

WeatherGod commented Oct 17, 2017

@mpetroff

This comment has been minimized.

mpetroff commented Oct 17, 2017

@jklymak I had only searched the issues, not the pull requests, so thanks for pointing that out.
@WeatherGod Yes, I meant color cycle. I wrote colormap, since I was looking at the set of colors on the colormap documentation page.

As @afvincent surmised, my main point is that the default color cycle should be color blind-friendly, since many people will just use the default.

@mpetroff mpetroff changed the title from Color blind-friendly qualitative colormap to Color blind-friendly default color cycle Oct 17, 2017

@dstansby

This comment has been minimized.

Contributor

dstansby commented Oct 19, 2017

I think this is really important and should be fixed as soon as possible. Are there major problems with changing the default color cycle? Would it be possible to do this in 2.2?

@WeatherGod

This comment has been minimized.

Member

WeatherGod commented Oct 19, 2017

@mpetroff

This comment has been minimized.

mpetroff commented Oct 19, 2017

I have some ideas for creating a tool for creating color blind-friendly color cycles and quantitative colormaps. The gist of it is to create a color picker that enforces a minimum perceptual distance between the different selected colors both for normal color vision and various degrees of color blindness, such as by using the color blindness simulation and color similarity tools in Colorspacious (these thresholds would be adjustable). I'll see if I can get a prototype together in the next month or so.

@lrq3000

This comment has been minimized.

lrq3000 commented Jan 29, 2018

@mpetroff This would be awesome! Any news on this?

@dstansby dstansby added this to the v3.0 milestone Jan 29, 2018

@mpetroff

This comment has been minimized.

mpetroff commented Jan 30, 2018

I made significant progress on this in October, building a web app with D3.js and some custom WebGL shaders, but haven't had time to work on it more recently.
screenshot
Most of the functionality is there, but I still need to add the color blindness simulation to the color distance constraint (it's currently only enforcing a minimum standard perceptual distance). I hope to have time to work on this again in the next month or two.

@mpetroff

This comment has been minimized.

mpetroff commented Mar 29, 2018

I found time to work on the color cycle picker the last few weeks and was able to mostly finish it. I pushed the code to mpetroff/color-cycle-picker and have a hosted copy at https://colorcyclepicker.mpetroff.net/. Feedback is definitely welcome (but should probably be left on the repository's issue tracker instead of here to avoid clutter).

The picker enforces a minimum perceptual distance between colors in CAM02-UCS and a minimum lightness distance. It also simulates protanomaly, deuteranomaly, and tritanomaly and enforces the minimum perceptual distance for the simulated colors, treating each CVD type separately. Colors are picked from a CAM02-UCS gamut. The minimum distances and the severity of the CVD simulation are all configurable.

screen shot 2018-03-29 at 14 30 33

@PaulEcoffet

This comment has been minimized.

PaulEcoffet commented Jul 25, 2018

Have you heard of I want hue ? It generates color map in a similar fashion as your color picker but with clustering instead. Might be interesting to have a look at their source code.

@mpetroff

This comment has been minimized.

mpetroff commented Aug 3, 2018

It takes a very different approach, and, unfortunately, I find many of the color sets it generates to be hard to distinguish, even when using the "colorblind friendly" preset. The clustering approach is an interesting concept, though.

@tacaswell tacaswell modified the milestones: v3.0, v3.1 Aug 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment