-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Enh color names #7639
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
Enh color names #7639
Conversation
Still hoping for a 'grey' variant; not sure what to do about the prefix. |
<https://github.com/vega/vega/wiki/Scales#scale-range-literals>`__ and | ||
`d3 | ||
<https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10>`__ | ||
originally developed at Tableau. |
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.
Add link here to the Tableau blog post describing their development?
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 offered to let Tableau pick where this link goes, still waiting to hear back from them.
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.
Will work on getting you that link soon.
If we go with T10, it implies that we will either have another namespace for the vega 20 colorscheme, or that we won't add those colors. |
This is set to the milestone 2.0. Is that on purpose? |
Yes, milestone is intentional. I would have claimed this is low risk, but I seem to have broken everything... |
It is because the color name cannot contain capital letters with our current code. |
(culprit being colors.py l.156, that checks that the lower case of the colorname provided is in a dictionnary). |
Just confirming that we at Tableau are quite happy to have you folks include any of our colors as long as they are properly credited (using tableau as the prefix would make that clear, of course, though it is a bit long). The Classic Tableau 10 and 20 have been in use for a while, are the ones currently under discussion. But, I have a new set of default colors that got designed according to this article, as well as many more palettes. |
@tacaswell should we change the prefix to tableau ? it is longer to type, but I think it is worth having an explicit name (T10 is a bit obscure). It also allows us to have only one namespace for the 10 and 20 color schemes and in addition fixes the capitalization issue. |
Another prefix to consider is tc (for Tableau Color). Putting the explanation in a comment next to the definition would both provide the mnemonic and give credit. |
I still prefer the explicit name "tableau". It is longer to type, but easier to remember. |
@@ -32,8 +32,13 @@ Colors in default property cycle | |||
-------------------------------- | |||
|
|||
The colors in the default property cycle have been changed from | |||
``['b', 'g', 'r', 'c', 'm', 'y', 'k']`` to the `Vega category10 palette | |||
<https://github.com/vega/vega/wiki/Scales#scale-range-literals>`__ | |||
``['b', 'g', 'r', 'c', 'm', 'y', 'k']`` to the ``__ to the category10 |
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 think there is a problem here.
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.
Thanks. I swear I know how to delete text....
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.
Typos.
* one of ``{'tc:blue', 'tc:orange', 'tc:green', | ||
'tc:red', 'tc:purple', 'tc:brown', 'tc:pink', | ||
'tc:gray', 'tc:olive', 'tc:cyan'}`` which are the Tableau Colors from the | ||
'T10' categorical palate (which is the default color cycle). |
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.
palette
``['b', 'g', 'r', 'c', 'm', 'y', 'k']`` to the `Vega category10 palette | ||
<https://github.com/vega/vega/wiki/Scales#scale-range-literals>`__ | ||
``['b', 'g', 'r', 'c', 'm', 'y', 'k']`` to the category10 | ||
color palete used by `Vega |
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.
palette
@tacaswell What are the next steps on this PR? I don't think we quite reached a consensus on the color palette namespace. |
is this the last thing blocking Matplotlib-2.0 ? could it be postponed to 2.0.1 ? (looks non critical) |
color names are part of the API. |
👍 to |
Current coverage is 62.10% (diff: 100%)@@ master #7639 diff @@
==========================================
Files 174 174
Lines 56051 56057 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34808 34814 +6
Misses 21243 21243
Partials 0 0
|
+1 for tc as well. |
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.
This looks good to me, but I can't for the life of me figure out why the coverage dropped so much.
@phobson the whole coverage report looks off, it says this PR adds 65 files. |
I still don't like "tc" as a prefix. It is very obscure. Someone suggested to me "tab", as it is both short, and avoids the "eau" that english speakers struggle with remembering. Are we interested in exploring other possible prefixes? |
(Else this looks ready to be merged) |
"tab" works for me. |
@NelleV I think this ship has sailed :/. My personal preference would be |
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.
Still want a 'grey', but this really should move along...
@QuLogic @tacaswell re: grey |
I am wary of adding extra colors given that we are adopting an existing palette. We already have import matplotlib.colors as mc
print(mc.to_hex(mc.to_rgb('gray')))
# '#808080' |
They are, as with the unprefixed colours, expected to be the same colour, not some new value. |
And in the unprefixed set, we have darkgray/darkgrey, darkslategray/darkslategrey, dimgray/dimgrey, gray/grey, lightgray/lightgrey, lightslategray/lightslategrey, slategray/slategrey with every pair equal to each other, so I don't see why this new palette can't have the same aliasing. Interestingly, the xkcd palette only spells it 'grey'. |
@QuLogic Sorry, completely missed that we already had 'tc:gray' and was responding to something un-related to what you were asking 🐑 My only concern about including two spellings of 'gray' in the palette is that users may want to use |
That would require (in practice) the dict being an OrderedDict, which may not be a bad idea in itself... |
e0c6dcf
to
5942a64
Compare
@anntzer That is also a good point and idea! |
(but then you need to know where to put the other spelling of grey/gray in the ordereddict) |
Looking at the work you did in |
To try and summarize all of the prefix discussions:
and I think I have written my self into preferring 'tab' |
Because of the initials aspect, at the very minimum we need a comment saying explicitly what |
On 2017/01/16 8:03 AM, Thomas A Caswell wrote:
and I think I have written my self into preferring 'tab'
"tab" is fine with me.
|
- change naming to tab - credit Tableau for developing the colors - support both spellings of grey an Tableau&xkcd colors - add tests of grey/gray equivalence and tableau order - use more explicit internal names + add comment
2810da3
to
317eaff
Compare
LGTM 👍 |
backported to v2.x as 4e1df0b |
This supersedes https://github.com/matplotlib/matplotlib/pull/7343/files
This is the result of an email conversation with Maureen Stone from Tableau.
We still need a link target for the default style changes to tableau.
The naming prefix 'T10' might need a bit more thought as these colors are actually from an older version of Tableau. They have since updated their colors and we should not name our selves into a corner.
@trpham would you be offended if I squashed your commits into 1?