8000 red/green scatter plots. Colorblindness friendlyness in Documentation · Issue #5435 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

red/green scatter plots. Colorblindness friendlyness in Documentation #5435

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

Closed
MaPePeR opened this issue Oct 19, 2015 · 19 comments
Closed

red/green scatter plots. Colorblindness friendlyness in Documentation #5435

MaPePeR opened this issue Oct 19, 2015 · 19 comments
Labels
Documentation Easy Well-defined and straightforward way to resolve Meta-issue General issue associated to an identified list of tasks

Comments

@MaPePeR
Copy link
MaPePeR commented Oct 19, 2015

I noticed this while reading the documentation on SVMs, but it might also be a problem on other pages.

The plots on that documentation page make heavy use of red and green to separate different types of classes in the scatter plot.
Given that red/green is the color combination that is the most common colorblindness i consider this a very bad choice.

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Oct 19, 2015 via email

@TomDLT TomDLT added the Easy Well-defined and straightforward way to resolve label Oct 19, 2015
@johannah
Copy link
Contributor

I'd like to tackle this. I've identified several plots that need changes to be colorblind friendly.

@giorgiop
Copy link
Contributor

I can do human testing here.

@amueller
Copy link
Member

It would be nice if we could use viridis. Maybe we should backport it? [ducks] Actually. We should seriously back port it.

@johannah
Copy link
Contributor

I think viridis would be ideal. Currently digging around to see if back porting is feasible.

@amueller
Copy link
Member

https://github.com/matplotlib/matplotlib/pull/4707/files#diff-893cf0348279e9f4570488a7a297ab1eR774 well it's not hard. but @GaelVaroquaux doesn't like including colormaps it 8000 seems ;)
I can see where he is coming from. It's more about scope that about "hard"

@johannah
Copy link
Contributor

I've included a few problem plots that I have updated manually to emulate Matplotlib's new colormap, viridis.

I am using the Firefox extension, Colorblind Design to view the images with colorblind simulator. You may also upload images here to view without an extension.

Original Image:
plot_multi_task_lasso_support_orig

Colorblind Friendly Version viewed normally:
plot_multi_task_lasso_support_cb

Colorblind Friendly Version viewed with Deuteranopia (most common):
-plot_multi_task_lasso_support_cb_deuteranopia

Colorblind Friendly Version viewed with Tritanopia:
plot_multi_task_lasso_support_cb_tritanopia

Colorblind Friendly Version viewed with Protanopia:
-plot_multi_task_lasso_support_cb_protanopia

Original Image:
novelty_detection_orig

Colorblind Friendly viewed normally - (this one was tough because of the number of colors needed, any color advice is welcomed):
novelty_detection_cb

Colorblind Friendly Version viewed with Deuteranopia (most common):
novelty_detection_cb_deuteranopia

Colorblind Friendly Version viewed with Protanopia:
novelty_detection_cb_protanopia

Colorblind Friendly Version viewed with Tritanopia:
novelty_detection_cb_tritanopia

Let me know if you agree with the style and process of manually updating colors.

@MaPePeR
Copy link
Author
MaPePeR commented Oct 22, 2015

I really like the new versions

@GaelVaroquaux
Copy link
Member

@johannah : could you please reference the PR in this issue. Thanks!

@giorgiop
Copy link
Contributor

Good job!

@glouppe
Copy link
Contributor
glouppe commented Oct 23, 2015

For ease of reuse and consistency, what are your opinions about defining styles somewhere globally and then import them in the examples? I am thinking about something like plt.xkcd() but for color blindness. Opinions @NelleV @GaelVaroquaux @amueller?

@GaelVaroquaux
Copy link
Member
GaelVaroquaux commented Oct 23, 2015 via email

@cmarmo
Copy link
Contributor
cmarmo commented Feb 14, 2022

The matplotlib default are now colorblind friendly, if I understand correctly (see #16808).
This issue consists in removing non-default colormaps in the documentation.

@cmarmo cmarmo removed the Needs Decision - Close Requires decision for closing label Feb 14, 2022
@cmarmo cmarmo added help wanted Meta-issue General issue associated to an identified list of tasks labels Aug 9, 2022
@ArturoAmorQ
Copy link
Member
ArturoAmorQ commented Aug 10, 2022

I am currently working on the Adjustment for chance in clustering performance evaluation example in #23708. It would be natural to make the modifications there.

I use the default matplotlib colormap but the rendered document still does not seem to be colorblind friendly. Do you know how to fix that?

@cmarmo
Copy link
Contributor
cmarmo commented Aug 10, 2022

I use the default matplotlib colormap but the rendered document still does not seem to be colorblind friendly. Do you know how to fix that?

... not really... :) ... sorry ... but you might want to have a look at #5555, it contains some examples of acceptable colormaps.

@ogrisel
Copy link
Member
ogrisel commented Sep 2, 2022

For the line plots, that need more than the 3 default colors (blue, orange, red), the fourth color is green with the default color map of matplotlib

Two options:

  • either add markers (cross, square, upper and lower triangles, ...);
  • alternatively, use the "seaborn-colorblind".
import matplotlib.style as style

style.use("seaborn-colorblind")

Or you could do both at the same time, as was done in #23708.

https://scikit-learn.org/dev//auto_examples/cluster/plot_adjusted_for_chance_measures.html

Personally, I like the colors of the default color map a bit better than the seaborn scheme, I think adding markers should be enough in most cases on line plots.

For other kinds of plots (e.g. scatter plots or heat maps) then we might need to find solutions on a case by case basis.

I think that for heat maps, I think the viridis colormap is a good default choice.

@betatim
Copy link
Member
betatim commented 8000 Sep 2, 2022

@cmarmo
Copy link
Contributor
cmarmo commented Oct 30, 2022

All the examples needing reworking have been modified.
Thanks to all the contributors who help to solve this issue!
Happy to close! 🚀

@cmarmo cmarmo closed this as completed Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Easy Well-defined and straightforward way to resolve Meta-issue General issue associated to an identified list of tasks
Projects
None yet
Development

No branches or pull requests

0