GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Implements the Okabe-Ito accessible colormap. by hyperphantasia · Pull Request #30821 · matplotlib/matplotlib Conversation
Contributor
PR summaryThis pull request proposes an implementation of the Okabe-Ito qualitative colormap introduced by this research paper:
The paper recommends "a set of colors that is unambiguous both to colorblinds and non-colorblinds". This colormap is supported by later research and is already implemented in software like ggplot2. It is also important in the book "Fundamentals of Data Visualization" by Claus Wilke.
PR checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
story645
requested changes
|
|
I‘m +1 on adding this. We should decide on a naming convention for color sequences. Right now we have some color sequences starting with a capital letter, some with lowercase https://matplotlib.org/devdocs/gallery/color/color_sequences.html. We don’t yet have ones consisting of multiple words. Options:
IMHO: 3 is not readable and errorprone due to similarity of capital I and lowercase l. 2. is a bit uncommon in that underscore+capitalization is rarely used together. 6. is too mashed together. My favorites are 1 and 5. 5 being the standard convention for python names. 1. is a common notation in texts to name things created by multiple authors „the Okabe-Ito color sequence“. Both are partially consistent with our current naming. What do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
IMHO 5: Using hyphens inside string dictionary keys is fine ({"okabe-ito": palette}) but it will throw syntax errors if used for variable names (the hyphen is the subtraction operator: okabe-ito reads as okabe - ito). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm also a vote for 5 since I think it's the most intuitive when folks are writing code. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
How do we stand to this comment?
Note: the original Okabe-Ito yellow is quite light and can be problematic in some print workflows. It is sometimes advised to replace it with a slightly darker amber variant (for example, #f5c710, as in ggplot2).
Do you have reference for that advice? In particular a discussion in ggplot2 or even a comment of the original authors on this would be helpful.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes:
From the R documentation. The trade-off with amber-variant is that it becomes less distinguishable from the orange (#e69f00) that is also present in the sequence but it's still OK in terms of ΔE (metric used to assess how distinguishable two colors are). A preview that helps observe that more clearly: If you prefer the amber variant, I will replace the original yellow: with the amber alternative: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
IMHO neither is really good and it depends on the display. 😢 With three tested displays, sometimes Yellow looks too faint, sometimes Amber is too close to Orange. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In this case I haven't found a best-of-all worlds proven solution. We could have a darker orange (a bit brownish then), but then we take the risk of messing with the red/green and lose points on CVD-friendliness.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I’d give the amber variant a +1, imho, it looks more versatile: better against white and thus more screen/print-friendly, while still remaining CVD accessible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Do we wanna split the difference and have 'okabe_ito' and 'okabe_ito_amber'? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@story645 Maybe that makes the palette a bit redundant somehow but that's the option the devs agreed upon in R/ggplot2.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@timhoffm Okay, in this case, the original sequence is already implemented in the latest commits. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Brooks-Code Please add a whats new entry. See https://github.com/matplotlib/matplotlib/blob/main/doc/release/next_whats_new/README.rst |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Changed title per @timhoffm recommendation. Co-authored-by: Tim Hoffmann <[email protected]>
There was an error while loading. Please reload this page.
|
Thanks for improving accessibility in mpl! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…rmap Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.