Skip to content
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

Add ten-color accessible color cycle as style sheet #27851

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mpetroff
Copy link
Contributor

@mpetroff mpetroff commented Mar 3, 2024

PR summary

(Following up from email.)

Adds a style sheet with the ten-color color cycle survey palette from Petroff (2021) [which will be published in a journal eventually]:
https://arxiv.org/abs/2107.02270
https://github.com/mpetroff/accessible-color-cycles

Related to (but does not fix) #9460.

At the moment, this PR contains only the minimal changes. I've only added the ten-color sequence from the paper and only done so as a style sheet.

The paper additionally contains six- and eight-color sequences, which could also be added.

Would it be better to add to _BUILTIN_COLOR_SEQUENCES in lib/matplotlib/colors.py with data in lib/matplotlib/_cm.py instead of as a style sheet?

I'm also open to naming suggestions. The current name is the placeholder I've been using, with ccs standing for "color cycle survey".

PR checklist

@tacaswell
Copy link
Member

I am very much in favor of taking this, but agree the name needs some workshopping.

We may also want to add these sequence(s) to

_BUILTIN_COLOR_SEQUENCES = {
'tab10': _cm._tab10_data,
'tab20': _cm._tab20_data,
'tab20b': _cm._tab20b_data,
'tab20c': _cm._tab20c_data,
'Pastel1': _cm._Pastel1_data,
'Pastel2': _cm._Pastel2_data,
'Paired': _cm._Paired_data,
'Accent': _cm._Accent_data,
'Dark2': _cm._Dark2_data,
'Set1': _cm._Set1_data,
'Set2': _cm._Set1_data,
'Set3': _cm._Set1_data,
}

@tacaswell tacaswell added this to the v3.10.0 milestone Mar 4, 2024
@tacaswell
Copy link
Member

If it is ready in the next week or so, it can go in 3.9, but I think it is important to get the names and such rather rather than rushing it through.

@kpedro88
Copy link

kpedro88 commented Mar 4, 2024

@mpetroff great to see this! As a user, I am in favor of adding the 6- and 8-color cycles.

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

Successfully merging this pull request may close these issues.

None yet

4 participants