-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
updated Blues colormap and demoted old Blues to legacy_Blues #4681
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
Conversation
Offhand, this sounds like a reasonable idea; but how many maps do you think you would be able to modify this way? For monocolor maps like this, is there a nice function that could be applied more generally? |
👍 Having a perceptual basis where we can have it is a good thing. Would this also work for ones like |
Just to record my opinion on this. I am not against creating better Yada, yada, yada,... Cats and dogs living together, mass hysteria!
|
@WeatherGod makes a good point; now I am not at all sure that this renaming is a good idea---or perhaps when it is and when it isn't. Maps like RdBu from ColorBrewer, for example, probably should not be renamed; if an improved RdBu-like map is constructed, it should have a different name--maybe just adding a very short prefix. |
I am in agreement with @kthyng. @WeatherGod makes an important point we should take very seriously. There is a great need for perceptual uniformity, in so much as it is possible. However, we don't want to break anyone's existing code to disenfranchise existing matplotlib users. I'm throwing out this one possible solution, adapted from @efiring (others should suggest theirs for discussion):
|
In cases where the changes are small I think I am in favor changing the color maps in place. I suspect (and am not sure how to prove) that the variation between monitors/projectors can be of the same degree as the difference between these two maps. My concern with tacking This ties back to the requests to change the RGBA values of the single character colors (ex 'r', 'b', 'g', ...) and the default on/off pattern of This particular proposal looks to have picked up a greenish tint to me which I am not a huge fan of. |
I am still in favor of actually changing what certain colormaps mean, like I'm ok with backing off on demoting colormaps that aren't being replaced I agree with @tacaswell that the new colormaps probably won't be used if On Tue, Jul 14, 2015 at 10:18 AM, Thomas A Caswell <notifications@github.com
Kristen M. Thyng |
I suppose one option would be to add a Boolean rc value "legacy_colormaps"
|
That is an idea. I am just about done with the "classic" style. It would be
|
If you are going to change them, use "CB_Blues" or "ColorBrewer_Blues" instead of "legacy_Blues", since that's where they are from. Also I've been meaning to check that the values in _cm.py are actually consistent with the original ColorBrewer Excel sheet. I think they were originally copied from somewhere else in an interpolated form and then had some of the redundant linearly-interpolated values removed? If the original 9 points specified in the original are smoothly interpolated in a perceptual colorspace (without clipping), I think that could remain under the original names, since it still passes through the same points? Could make them slightly better, but I'm not sure how noticeable it would be. Update: I went through and converted all the ColorBrewer maps to RGB format, taken directly from the Excel spreadsheet in this commit: endolith@411d0b3 in this PR: #3973 |
I agree with Michael on this. What would be cool is to have a "palette" On Sat, Jan 23, 2016 at 4:27 PM, Michael Waskom notifications@github.com
|
After the discussion here we have decided to not change the color maps returned by an existing name. Instead we would like to add a new name space for color maps which are derived from the perceptually uniform model. Given that this will not break any user code, this can be punted to 2.1. |
That makes sense to me — thanks for the all the useful comments! On Mon, Jan 25, 2016 at 3:30 PM, Thomas A Caswell notifications@github.com
Kristen M. Thyng |
I think we missed the window for this with 2.0 😞 Sorry @kthyng Thank you for your work on this! For people who come across this issue in the future see https://matplotlib.org/cmocean for more great color maps. |
Based on evolving conversations in the scipy community (particularly during the SciPy conference last week), I'm proposing to update the colormaps structure in matplotlib. I've remade the Blues colormap as an example, in this PR. The new structure would emphasize good colormap practices and would break some backward compatibility. (I suspect most people won't notice their colormaps changing if they have specifically called for 'Blues' since they look similar, but if they were specifically calling for 'jet' in the new structure, it wouldn't know where to find it since it would instead be 'legacy_jet'.) This would be in support of the default colormap change.
I've replaced the colormap definition dictionary for 'Blues' with a colormap I remade using the viscm tool from @njsmith and @stefanv for creating perceptually uniform colormaps. I moved the old Blues dictionary to 'legacy_Blues' so that people can still access it if they so choose. The new colormap is slightly improved to have uniform perceptual increases in the colormap in cam02ucs colorspace, but is also intended to look similar to the old colormap. You'll notice that the gradient through the colormap is more even in the new colormap as compared with the old. For example, the light and dark end of the proposed 'Blues' colormap have similar perceived differences between steps, whereas in the current colormap, the light end appears to have smaller gradients (for the same quantitative step) than the darker end.

Current:
Proposed:

My proposal would be to do something similar for the other sequential and diverging colormaps: updating them and burying the previous version under 'legacy_*'. I would also plan to create another page for the documentation to showcase the "approved" colormaps which would have subpages to show the legacy colormaps as well as others that won't be replaced but that we don't recommend using (like jet). So, all colormaps and more would still be available, but the colormaps would be slightly different for some, and access would decrease for others.
You can test the colormaps in this PR by making your favorite pcolor plot using cmap='Blues' to try the new colormap and cmap='legacy_Blues' to compare with the old/current colormap. This colormap could be adjusted using the viscm tool; it was just what I came up with from some fiddling.
I think @efiring, @tacaswell, @WeatherGod, @dmcdougall, @mdboom, @jenshnielsen, @pwolfram, and others might have input.