-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Introduce new Tableau colors #12009
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
Introduce new Tableau colors #12009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine except for the name. When tableau 12 comes out will we call the palette tabxii? If we are to have all these palettes I wonder if we need to think how they are organized.
@@ -3,7 +3,7 @@ | |||
Color Demo | |||
========== | |||
|
|||
Matplotlib gives you 8 ways to specify colors, | |||
Matplotlib gives you 9 ways to specify colors, | |||
|
|||
1) an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g. ``(0.1, 0.2, 0.5)`` | |||
or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d say tab10:
Are these all really different “ways” to specify colours? If we are to have all these palettes I suggest specifying a palette is another way and then list all the palettes as a sub list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then list all the palettes as a sub list
Yes that is a very good idea.
That is not really possible. The current default colors are named |
5a571a2
to
9594f19
Compare
9594f19
to
3220bb2
Compare
Ok my knee jerk reaction is that this can get out of hand and we need some way to organize all these string-enabled colours since these aren’t just style files. Someone had solarized colours the other day and there are endless other lists of colours out there. Maybe this is a good chance to step back and think about how we manage these. Particularly as this one is so close to a previous one and has the same name |
Actually, for me personally it would suffice to create a respective colormap. I never used any of the named colors with a prefix before. In view of #10840 and some of the suggestions therein I could well imaginge to have a single object |
You can get the RGB values of a listed colormap from cmp.values if that helps. I added this to the weekly call agenda as a bit of discussion may help. Not sure the call will happen this week |
It's The idea for organizing colors from above would be to have a single
One could read in the colors into
such that for any colormap with names in it there will be all colors in the palette notation available. |
I don't have the time to get deeper involved here right now. We have two only loosely related issues here:
Issue 1 is certainly worth a thorough design discussion. Currently, we use a Issue 2 is the naming of the palettes (or whatever we want to call it). Unfortunately, the naming is not quite consistent. We have:
Disregarding the existing names for a moment, I would say, that a naming pattern
The new colors would then be
One option would be to just introduce the latter. Another option would be to deprecate the names tab, tab10, tab20 and replace them by the former. Note: This change is independent of if we want to move on to something different than a |
As much as I love the clarity of I think a simple numbering scheme would work. For instance, Set1, Set2 have different numbers of colors and we don't call that out in there names. So I don't think that tableau20 and tableau20b need to be distinguished further -- though the missing "a" suffix on tableau20 does make my eye twitch a bit ;) |
@phobson Do you have a suggestion based on the above for the new tableau colormap/palette? Also, what do people think about the second point - Color order? |
@ImportanceOfBeingErnest I could go for "tab10b" or "tab10_v2" or "tab10_2018" none of them are great, but at least they're not |
A simple numbering scheme can indeed work. However,
My goal is to have some sort of consistency in the naming pattern so that users don't stumble over it. I don't think this is overthinking. If the original names would just have been tab1, tab2, tab3, tab4. That would have been ok. I strongly advise against either of "tab10b" or "tab10_v2" or "tab10_2018". We should at least keep the naming pattern consistent between the old and new tab variants. (Would we then have tab10b20b?). I think adding a separation char between the name and subtype is still the best thing to do. If we don't do that, the original Concerning order, we should go for the original order of the colormap. The designers have made that change intentionally and we should stick with their decision for the Tableau10 colormap. A separate question is the default color cycle in matplotlib. Is it correct, that we currently use the tableau colors in the color cycle? I would not change these in a minor release, i.e. that's a discussion for matplotlib 4.0. |
The old tableau colors are indeed what is used in the matplotlib color cycle and they are the colors provided in Those go under the name All other categorical colormaps' names (Set1, accent, Paired...) are identical to vega. Vega names the new Tableau colors Just to be clear here, I'm not proposing to change the default color cycle here, nor to rename any of the existing colormaps because that always causes some unnecessary friction. |
Part of me thinks that the best course of action here is "do nothing" and defer people to https://jiffyclub.github.io/palettable/tableau/ and reach out to Matt to see if we can help keep palettable up to date. |
We should also consider if we want that many variant of the same color palette. While I think having options is good, having too many options hampers usability. |
We should also get explicit approval from Tableau before we merge this (as we did for adding the current set). We do not ship parula because Mathworks has asserted IP over it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approval from Tableau to include these colors
Anyone can clear this once we have permission.
Alright, so before asking for permission one should of course be clear on whether those colors should actually be added. There currently seem to be some objections and it would be quite embarrassing to first obtain permission and later decide against. |
My vote is that these look nice, but don't bring enough new to the table to be added to the existing colors. In particular, I don't think they merit another bunch of named colors (i.e. that get string names). Per the discussion on the call:
|
This was a beard-crumb we left during the 2.0 discussions that we did not follow up on yet. I think it should look something like |
... that looks great, though I'm not sure I like the idea of leaving a "beard-crumb"... |
For anyone looking to get the Tableau colors into matplotlib, I suppose the recommended way is
(I don't see that much of a need for a registration API if all it's doing is adding some characters and a |
You can simply
Though I'm not sure if that should be allowed. Why are you calling And that's part of the problem I see. You shouldn't be able to mess with the color name table directly. There's no clear definition of the format. While that could be added, more importantly, there's no input validation. I can do
resulting in Not having a registration API also means, that we get tied to the current implementation. |
So I'll close this. What happened with the stylesheet repository? @story645? |
There's user contributed colormaps https://github.com/pyviz/contrib_colormaps For stylesheets in particular @dhaitz has been building a tools for folks that I'd love to see integrated somehow: |
OK, maybe the style sheets are too matplotlib specific and we need to make our own repository? Not that the pyviz repository has gotten a lot of take-up yet. |
Eh...someone would have to maintain and advertise it so that there would be uptake... and we should possibly update our docs w/ links to both repos. We can discuss on the call. |
PR Summary
As was mentionned by @josesho in #11927 (comment),
Tableau changed their default categorical colors in version 10 of their software.
Those colors are also available in Vega as "tableau10". Similarly a new set of 20 colors got introduced.
The new colors are less saturated and are hence pretty useful for colorzing larger areas in plots, e.g. for bars, pies etc. I would hence propose to add them to matplotlib as well.
There are two things to note here, for which I would also like to have feedback:
1. Naming
Since the default matplotlib (=old tableau) colors are already named
tab:...
, one cannot use this name. I am currently usingtabx
instead, due to the latin number X being 10 and the colors being introduced in version 10 of tableau.tabx:colorname
for the individual colorstabx10
andtabx20
I find this not ideal, so I would ask for better ideas for naming.
2. Color order
The new colors' hues are in a different order than the old ones and hence the matplotlib default cycler. You see the original order in the left column in the picture below. In the right column I reordered them to match with the matplotlib defaults. Two options:
i. Keep the Tableau - order. Advantage: Consistency with "Tableau" and "Vega". (this is the current status of this PR.)
ii. Change to the matplotlib order. Advantage: Easy and consistent replacement for existing plots. Red is not next to orange (which looks strange with 3 color plots).
PR Checklist