Re: [matplotlib-devel] Another colormap

2011-09-22 Thread Nathaniel Smith
On Sep 21, 2011 5:29 PM, "Christoph Gohlke"  wrote:
> On 9/13/2011 12:24 AM, Eric Firing wrote:
> > On 07/18/2011 07:07 AM, Sameer Grover wrote:
> >> I came across this website where different colormaps have been compared
> >> and the author has come up with an optimal colormap for data
> >> visualization called the "cool-warm colormap".
> >>
> >> http://www.cs.unm.edu/~kmorel/documents/ColorMaps/index.html
> >>
> >> It is somewhat similar to the cool colormap already included in
> >> matplotlib, but I've added the new colormap to matplotlib in the patch
> >> attached in case it is deemed fit to be included in the matplotlib
source.
> > We should include this, but I think the 257-entry version is overkill;
> > it adds a big chunk to the _cm.py file, and I doubt it is visually
> > distinguishable from the 33-entry version.  Would you mind providing a
> > patch for the latter?  (Or better yet, the functions that generate the
> > r,g,b values.)
> Here's a pull request for the 33 entry map:
> 

Let me open a can of worms here...

I looked at the paper, and the goal was specifically to produce a good
"default" colormap - not necessarily the best for any situation, but good
overall and certainly better than the rainbow ('jet') colormap in most
cases. (I agree with the author that jet is pretty terrible and tends to
distort data.)

Should we switch to this as the default matplotlib colormap? I think it
would be a clear improvement.

- Nathaniel
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Another colormap

2011-09-22 Thread Tony Yu
On Thu, Sep 22, 2011 at 5:16 PM, Nathaniel Smith  wrote:

> On Sep 21, 2011 5:29 PM, "Christoph Gohlke"  wrote:
> > On 9/13/2011 12:24 AM, Eric Firing wrote:
> > > On 07/18/2011 07:07 AM, Sameer Grover wrote:
> > >> I came across this website where different colormaps have been
> compared
> > >> and the author has come up with an optimal colormap for data
> > >> visualization called the "cool-warm colormap".
> > >>
> > >> http://www.cs.unm.edu/~kmorel/documents/ColorMaps/index.html
> > >>
> > >> It is somewhat similar to the cool colormap already included in
> > >> matplotlib, but I've added the new colormap to matplotlib in the patch
> > >> attached in case it is deemed fit to be included in the matplotlib
> source.
> > > We should include this, but I think the 257-entry version is overkill;
> > > it adds a big chunk to the _cm.py file, and I doubt it is visually
> > > distinguishable from the 33-entry version.  Would you mind providing a
> > > patch for the latter?  (Or better yet, the functions that generate the
> > > r,g,b values.)
> > Here's a pull request for the 33 entry map:
> > 
>
> Let me open a can of worms here...
>
> I looked at the paper, and the goal was specifically to produce a good
> "default" colormap - not necessarily the best for any situation, but good
> overall and certainly better than the rainbow ('jet') colormap in most
> cases. (I agree with the author that jet is pretty terrible and tends to
> distort data.)
>
> Should we switch to this as the default matplotlib colormap? I think it
> would be a clear improvement.
>
I have absolutely no clout here, but I'd definitely be in favor of changing
the default colormap away from "jet".

Personally, I'd prefer a two-tone colormap as the default (two-distinct
tones at the limits with a gradient in-between---dubbed "sequential" in the
paper) instead of a three-tone colormap (three-distinct tones---dubbed
"diverging" in the paper). (I think this is a more common use case, and I
think using a "diverging" colormap effectively requires setting vmin/vmax.)
But really, (almost) anything is better than "jet".

Don't misunderstand: I know I can change the default colormap in my
matplotlibrc file (and this is what I do). But 90% of people don't bother to
change the defaults. If changing this default in matplotlib prevents just 1
person from publishing a paper with a "jet" colormap, I think we'll have
made the world a better place. ;)

-Tony
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Another colormap

2011-09-22 Thread Benjamin Root
On Thursday, September 22, 2011, Tony Yu  wrote:
> On Thu, Sep 22, 2011 at 5:16 PM, Nathaniel Smith  wrote:
>>
>> On Sep 21, 2011 5:29 PM, "Christoph Gohlke"  wrote:
>> > On 9/13/2011 12:24 AM, Eric Firing wrote:
>> > > On 07/18/2011 07:07 AM, Sameer Grover wrote:
>> > >> I came across this website where different colormaps have been
compared
>> > >> and the author has come up with an optimal colormap for data
>> > >> visualization called the "cool-warm colormap".
>> > >>
>> > >> http://www.cs.unm.edu/~kmorel/documents/ColorMaps/index.html <
http://www.cs.unm.edu/%7Ekmorel/documents/ColorMaps/index.html>
>> > >>
>> > >> It is somewhat similar to the cool colormap already included in
>> > >> matplotlib, but I've added the new colormap to matplotlib in the
patch
>> > >> attached in case it is deemed fit to be included in the matplotlib
source.
>> > > We should include this, but I think the 257-entry version is
overkill;
>> > > it adds a big chunk to the _cm.py file, and I doubt it is visually
>> > > distinguishable from the 33-entry version.  Would you mind providing
a
>> > > patch for the latter?  (Or better yet, the functions that generate
the
>> > > r,g,b values.)
>> > Here's a pull request for the 33 entry map:
>> > 
>>
>> Let me open a can of worms here...
>>
>> I looked at the paper, and the goal was specifically to produce a good
"default" colormap - not necessarily the best for any situation, but good
overall and certainly better than the rainbow ('jet') colormap in most
cases. (I agree with the author that jet is pretty terrible and tends to
distort data.)
>>
>> Should we switch to this as the default matplotlib colormap? I think it
would be a clear improvement.
>
> I have absolutely no clout here, but I'd definitely be in favor of
changing the default colormap away from "jet".
>
> Personally, I'd prefer a two-tone colormap as the default (two-distinct
tones at the limits with a gradient in-between---dubbed "sequential" in the
paper) instead of a three-tone colormap (three-distinct tones---dubbed
"diverging" in the paper). (I think this is a more common use case, and I
think using a "diverging" colormap effectively requires setting vmin/vmax.)
But really, (almost) anything is better than "jet".
>
> Don't misunderstand: I know I can change the default colormap in my
matplotlibrc file (and this is what I do). But 90% of people don't bother to
change the defaults. If changing this default in matplotlib prevents just 1
person from publishing a paper with a "jet" colormap, I think we'll have
made the world a better place. ;)

If it only prevents one person from publishing in "jet", then we really
stink in our jobs of promoting matplotlib...

Anyway, this is certainly is worthy of debate, but it certainly won't happen
for this release.  We should be cutting RC tomorrow.

After the release, I encourage you guys to make your cases.  Show us plots
that have been in "jet" and show them as better in another colormap.

As a bit of a challenge to you all, I am not color-blind, but I do wear
tinted glasses that make it difficult to tell the difference between darker
blues and black, and sometimes greens and blues are hard to distinguish.
 Furthermore, as a radar meteorologist, I am very accustomed to the
colormaps commonly used for radar reflectivies (and is similar to "jet").

Of course, I am not the only one to convince (and others could certainly
overrule me)...

Ben Root
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Another colormap

2011-09-22 Thread Nathaniel Smith
On Thu, Sep 22, 2011 at 7:00 PM, Benjamin Root  wrote:
> On Thursday, September 22, 2011, Tony Yu  wrote:
>> On Thu, Sep 22, 2011 at 5:16 PM, Nathaniel Smith  wrote:
>>> I looked at the paper, and the goal was specifically to produce a good
>>> "default" colormap - not necessarily the best for any situation, but good
>>> overall and certainly better than the rainbow ('jet') colormap in most
>>> cases. (I agree with the author that jet is pretty terrible and tends to
>>> distort data.)
>>>
>>> Should we switch to this as the default matplotlib colormap? I think it
>>> would be a clear improvement.
>>
>> I have absolutely no clout here, but I'd definitely be in favor of
>> changing the default colormap away from "jet".
>>
>> Personally, I'd prefer a two-tone colormap as the default (two-distinct
>> tones at the limits with a gradient in-between---dubbed "sequential" in the
>> paper) instead of a three-tone colormap (three-distinct tones---dubbed
>> "diverging" in the paper). (I think this is a more common use case, and I
>> think using a "diverging" colormap effectively requires setting vmin/vmax.)
>> But really, (almost) anything is better than "jet".

For those following along, the article is here:
http://www.cs.unm.edu/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf
The discussion about whether to use a "sequential" or "diverging" map
is in section 3.

I had the same gut reaction as you, but found the paper fairly
convincing. I'm used to diverging maps that really highlight the
center point, like matplotlib's RdBu colormap, and use them all the
time for data where the zero point really matters (and set vmin/vmax
appropriately, like you say). But this colormap is actually really
different from the ones I'm used to, because it's really designed
*not* to highlight the center point as being special. The clearest
example of this is Figure 8 in the paper -- the image on the left is
the one that you'd get from something like RdBu, and the one on the
right is what this colormap produces. And, like he says, it gives you
better detail than a sequential map could.

I actually *wouldn't* want to use this for images that I currently use
RdBu for. But I'm picky -- the map he suggests would still make a heck
of a better colormap for those images than jet does, and Rdbu *really*
isn't appropriate for general use.

On Thu, Sep 22, 2011 at 7:00 PM, Benjamin Root  wrote:
> Anyway, this is certainly is worthy of debate, but it certainly won't happen
> for this release.  We should be cutting RC tomorrow.
>
> After the release, I encourage you guys to make your cases.  Show us plots
> that have been in "jet" and show them as better in another colormap.

Figure 16 in that paper (page 17) is a good start. In the examples
given, for both of the top two jet actively distorts the features of
the data. In row 1, it makes it look like the bars taper off as you
move towards the top of the image, which they don't (compare to the
greyscale image for reference). In row 2, it makes it look like the
"circles" vary in size across the image (which, again, they don't). In
the bottom two images, jet introduces apparent asymmetries that aren't
there: in row 3, you have these 5 apparent stripes of unequal width,
and the yellow is narrower than the cyan. In row 4, well, it's just
obviously terribly misleading. (This isn't surprising, since 'jet'
sweeps through the frequencies of visible light; the big band of
yellow in simulated deuteranope vision corresponds to where they're
missing one of the spectral sensors that most of us have.)

If you want more examples though I can certainly pull some out of my thesis :-).

> As a bit of a challenge to you all, I am not color-blind, but I do wear
> tinted glasses that make it difficult to tell the difference between darker
> blues and black, and sometimes greens and blues are hard to distinguish.
>  Furthermore, as a radar meteorologist, I am very accustomed to the
> colormaps commonly used for radar reflectivies (and is similar to "jet").

No colormap is going to be perfect for everyone, and maybe someone
else will pop up with a pointer to a map that's even better supported
than this one. I just think that jet has sufficiently manifest flaws
that it would be a great favor to science if we could switch to
*something* better as our default.

-- Nathaniel

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel