-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Replace "jet" as the default colormap #875
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
Comments
There have been two related discussions on the [matplotlib-devel] mailing list: Another colormap and Implementation of cubehelix color scheme. Btw, the hot/heat colormaps perform poorly with 3D shading. |
In what way? Here's jet compared to hot: |
That seems to be an objection against using it for 3D CAD? Can you even do things like that in matplotlib? I don't see anything like it in the gallery. I agree with this comment from the mailing list:
The coolwarm is meant for "diverging" data, with dark blue negative values, bright white middle 0 values, and dark red positive values (same dark-light-dark problem as But obviously, nothing will be perfect for every case. Different maps are more appropriate for different situations. Unless there's a way to set different defaults for different types of plots, we just have to pick one that will work better than |
I'm +1 for changing colormap to something more sane than We probably have examples in the test suite that rely on the reference images being rendered in 'jet' - those reference images would have to either be changed, or the default cm switched to jet for testing, and back to the default again post testing. It should be noted that the default colormap can currently be set via an rcParam. In your
or
etc... If there are places in the code where this cmap setting is not respected (except for instances where it is explicitly specified), those should be considered bugs and should be filed as such. |
I don't see any polite way to make such a change (different default colormap). Everyone is used to the nice, colorful jet popping up. I predict that if it is changed, there will be a lot of unhappy users. User code will not behave the way it used to, in a very obvious and major way. Instead of changing the default (at least initially), it would be better to change the gallery examples and documentation to explain and illustrate better colormap choices for various purposes. This can be done incrementally, without breaking any user code. |
@efiring, I think that is an excellent idea. We might one day change the default, but this approach might begin the movement from within the userbase. Over time, we might even be able to figure out what a suitable default is. |
I still think the default should be changed sooner than later, and that the user who doesn't care enough to change the default isn't going to care if the default changes, but improving the demos is a good idea, too. It looks like it's not as simple as changing the cmap alone, though, since some have bipolar data and want a diverging colormap, but the colormap isn't currently centered. The seismic colormap highlights the midpoint well. I used this and it worked:
Is there a better way to center the colormap? |
It is actually the norm, not the colormap, that is being centered. You raise a good question. There should be an automatic way (selected by a kwarg) to achieve what you are doing manually, but in general there isn't. I am working on a branch to take care of it, so I expect to have a pull request ready within a few days. |
Ok, so actually instead of setting vmax vmin, I should be using something like What will be the syntax for your addition? If the data happens to vary from 4 to 10, and the defined midpoint is 5, we should be able to just say "the midpoint of the colormap is 5" and it will automatically use the extreme values to set the colormap range from 0 to 10. |
These are some changes in the branch where I'm changing the example colormaps:https://github.com/endolith/matplotlib/compare/c6fac36ed3c5f14c2a9863d9c68f6a8fa068fcbc (Not sure how else to link to a branch) |
On 06/04/2012 04:46 AM, endolith wrote:
Not necessarily; when vmin, vmax kwargs are available, they are being
Yes, that is exactly what I have in mind. I have a branch started to do |
That sounds like a good keyword to me. If you do include vmid and vmax, then vmin is if you include all three, the scale is non-linear, normalized independently from the midpoint to the max point and from the midpoint to the min point? http://stackoverflow.com/q/7404116/125507 |
On 06/05/2012 05:18 AM, endolith wrote:
No to both. It's much simpler than that. Think of it this way. First, |
Just thinking out loud, I remember being able to specify just vmin or just vmax and let the autoscaling handle the unspecified end. Is that still the case? |
On 06/06/2012 08:37 AM, Benjamin Root wrote:
Yes. |
Just wanted to note here that I have a |
Maybe the symmetric norm stuff should be added under #632? |
Closed after #921 merge |
(I'm still in favor of changing the default, for the record.) :) |
I (very belatedly) add a vote for changing the default color map. |
FYI, "jet" won't be the default colormap for MATLAB anymore. The new release has finally improved this and other related aspects. http://www.mathworks.es/products/matlab/matlab-graphics/#new_look_for_matlab_graphics |
Well, at least someone is doing it. Hopefully open source projects copy this now instead of copying jet? |
Regardless, changing the default color map is still an api break which we won't do until 2.0. |
As this point was a bit lost in the discussion if to break the API, which of the MPL's colormaps would be considered as the best alternative to |
|
👍 on gray. The |
Thanks Paul, I was wondering about the length of that URL... Anyway, the tl;dr; of the video is that, yes, Lab space does measure color On Wed, Jul 15, 2015 at 3:13 PM, Paul Ivanov notifications@github.com
|
@scottsievert: Is there text somewhere saying that XYZ space was used to calculate perceptual differences? If so it'd be good to know so we can correct it -- we used CAM02-UCS, which is a perceptually uniform space that improves on CIEL_a_b_. To get to either CAM02-UCS and CIEL_a_b_ space you have to pass through XYZ -- here's the transformation graph supported by colorspacious 0.1.0 -- but that's an implementation detail... [Edit for clarify: CAM02-UCS is the J'a'b' node in the lower-right.] |
Got it. In your talk mentioned above, you referred to the XYZ space more often and I assumed that's what you were using to calculate the perceptual differences. It's good to know otherwise and I'll trust you on this. |
Ah, gotcha, right, that could definitely have been clearer. Something to On Wed, Jul 15, 2015 at 2:44 PM, Scott S. notifications@github.com wrote:
Nathaniel J. Smith -- http://vorpus.org |
See also #4707 |
@michaelaye I only noticed this comment of yours today. I have a version of Kindleman linear lightness colormap in the second half of this notebook tutorial. Using the same data and function in the notebook I also replicated his circular colormap. it's been sitting on my home computer for a while, I just uploaded it on GitHub here. |
🌟 👯 🌟 |
This is subjective: a matter of sane defaults vs consistency with matlab, but here are the arguments against
jet
as default:Rainbow Color Map (Still) Considered Harmful:
So this would presumably mean using one of
hot
,afmhot
, orgist_heat
as the default colormap:How NOT to Lie with Visualization:
Let’s talk colormaps:
The 'jet' colormap must die!:
The text was updated successfully, but these errors were encountered: