Skip to content

New color blind-friendly color cycle #9255

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 3 commits into from
Nov 13, 2017

Conversation

Perseudonymous
Copy link
Contributor

PR Summary

There is only one color blind-friendly color cycle included in matplotlib at present (not counting the grayscale cycle). This pull request adds another defined from the color blind 10 cycle from Tableau. This uses more colors than the seaborn-colorblind cycle.

I assume the use of the name is fine given the discussion in this pull request: #7639

PR Checklist

Most of this

  • N/A Has Pytest style unit tests
  • N/A Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@tacaswell tacaswell added this to the 2.2 (next next feature release) milestone Sep 30, 2017
@tacaswell
Copy link
Member

attn @mcstone to verify that the name is still ok in this case.

@mcstone
Copy link

mcstone commented Oct 2, 2017 via email

@jklymak
Copy link
Member

jklymak commented Oct 2, 2017

Probably beyond the scope of this PR:

... are style sheets the only way to define color cycles? It seems a big step from the seaborn styles to defining just the color cycle.

I ask because I was going to suggest an example, but I see that all the styles are plotted automagically, so I guess its not needed. OTOH, if everyone who wants a custom color cycle writes a new style, that page will get quite crowded...

@WeatherGod
Copy link
Member

WeatherGod commented Oct 2, 2017 via email

@jklymak
Copy link
Member

jklymak commented Oct 2, 2017

@WeatherGod I think I knew about that. But I mean is there somewhere in the library to define a bunch of colorcycles by name like there is to define a bunch of colormaps? i.e. something like lib/_cc.py or lib/_colorcycles.py?

@WeatherGod
Copy link
Member

WeatherGod commented Oct 2, 2017 via email

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

A couple of suggested changes to make it clear to folks that this is done via matplotlib styles.

@@ -0,0 +1,4 @@
New colorblind-friendly color cycle
Copy link
Member

@jklymak jklymak Oct 2, 2017

Choose a reason for hiding this comment

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

Suggest "New style defining colorblind-friendly color cycle"

New colorblind-friendly color cycle
===================================

A new color cycle has been added, tableau-colorblind10, to provide another option for colorblind-friendly plots.
Copy link
Member

@jklymak jklymak Oct 2, 2017

Choose a reason for hiding this comment

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

Suggest "A new style has been adding defining a color cycle tableu_colorblind10 ..."

Suggest a link to: :ref:sphx_glr_tutorials_introductory_customizing.py (Umm, I think I referenced that correctly)

@jklymak
Copy link
Member

jklymak commented Oct 2, 2017

@WeatherGod Thanks! I looked more carefully at the existing files in mpl_data/stylelib , and quite a few of them are just color cycles like this PR. I guess this makes sense since you can combine style sheets, and I'm sure its not worth adding another layer of complexity.

@jklymak
Copy link
Member

jklymak commented Oct 18, 2017

@EJEP I took the liberty of making very small changes to your whats new entry.

This isn't building because of a change to doc/conf.py.

@dstansby
Copy link
Member

dstansby commented Nov 4, 2017

This needs a rebase on to current master to make the CircleCI build work

Perseudonymous and others added 3 commits November 11, 2017 09:58
There is currently only one colorblind friendly color cycle in the included
style sheets. This adds another - the colorblind 10 palette from Tableau.
@dstansby dstansby force-pushed the tableau-colorblind10 branch from cb6703b to 25ea897 Compare November 11, 2017 09:59
@dstansby
Copy link
Member

I think it would be really good to get this in, so I've rebased on to master to hopefully make all the tests pass.

@WeatherGod WeatherGod merged commit 49c6f50 into matplotlib:master Nov 13, 2017
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants