Skip to content

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

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

Merged
merged 4 commits into from
Aug 22, 2024

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.

Copy link
Contributor

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the discussion in mpetroff/accessible-color-cycles#1 this PR would adopt the petroffX name scheme.

@tacaswell
Copy link
Member

I took the liberty of accepting the naming change, adding it to the sequence registry, and fixing the rebase.

@matthewfeickert
Copy link
Contributor

@mpetroff can we get an approval from you that you're good with the name changes discussed in mpetroff/accessible-color-cycles#1 that were adopted here?

@mpetroff
Copy link
Contributor Author

@mpetroff can we get an approval from you that you're good with the name changes discussed in mpetroff/accessible-color-cycles#1 that were adopted here?

Yes, I'm good with it.

@matthewfeickert
Copy link
Contributor

@tacaswell @mpetroff Can we rebase this off main again as the CI seems to be fixed there now, and then this should be good to merge whenever.

@mpetroff mpetroff force-pushed the add-ccs-color-cycle branch from c886314 to ff584d7 Compare August 18, 2024 20:05
Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done in a followup, but would be nice if this got added to the following for discoverability:

ETA: also I'm really psyched this is going in, thanks for your work on this folks!

@tacaswell tacaswell merged commit 1056e0f into matplotlib:main Aug 22, 2024
43 checks passed
@tacaswell
Copy link
Member

I went ahead and merged this and opened issue for the additional examples / documentation.

@tacaswell
Copy link
Member

Thank you @mpetroff !

@mpetroff mpetroff deleted the add-ccs-color-cycle branch August 22, 2024 17:34
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.

5 participants