Re: [matplotlib-devel] release strategy and the color revolution

2015-02-16 Thread Michael Waskom
On Mon, Feb 16, 2015 at 3:15 PM, Eric Firing  wrote:

> Does anyone have a suggestion for a colorblind-friendly cycle?  Maybe
> omit the green and tack a gray on the end?  I haven't checked, so I
> don't know if this would work well.
>

Here are two palettes that are optimized for colorblindness:
http://www.cookbook-r.com/Graphs/Colors_%28ggplot2%29/#a-colorblind-friendly-palette

Seaborn has a `colorblind` palette that is somewhere between these colors
and the standard matplotlib/seaborn set. It's intended to be a little
better than deep (which actually isn't too bad in terms of red vs green),
but it's not been extensively tested or optimized.


> It is common to have plots with two curves, and the present blue, green
> pair is not very high-contrast; having the first two colors be blue and
> red would be better, I think.
>

+1
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-16 Thread Michael Waskom
On Mon, Feb 16, 2015 at 3:19 PM, Michael Waskom 
wrote:

> Here are two palettes that are optimized for colorblindness


actually I should say I have no idea if those are optimal, but the
simulations do suggest they work well.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-16 Thread Michael Waskom
On Mon, Feb 16, 2015 at 2:01 PM, Eric Firing  wrote:


>
> Here is what I think is the most recent extensive thread:
> http://comments.gmane.org/gmane.comp.python.matplotlib.devel/13122

...


> 1) A greyscale has been proposed; it satisfies several of the criteria
> very well, but misses by omitting hue entirely.  It is proposed as a way
> to force users to choose something other than the default; I don't think
> this is a good *competitive* strategy.
>
> 2) YlGnBu or YlGnBu_r seems to me to be a viable candidate.  It has the
> great advantage that we already have it.  It seems to rate well by most
> of the criteria illustrated via Nathaniel's
> https://github.com/njsmith/pycam02ucs viscm() tool. (Perceptual distance
> is a little jumpy.)
>


> Others?
>

Nathaniel's January 9 message in that thread (can't figure out how to link
to it in the archives) had a suggestion that I thought was very promising,
to do something similar to Parula but rotate around the hue circle the
other direction so that the hues would go blue - purple - red - yellow. I
don't think we've seen an example of exactly what it would look like, but I
reckon it would be similar to the middle colormap here
http://earthobservatory.nasa.gov/blogs/elegantfigures/files/2013/08/three_perceptual_palettes_618.png
(from the elegant figures block series linked above), which I've always
found quite attractive.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-16 Thread Michael Waskom
It's helped by pulling the green towards blue and the red towards yellow,
but they are probably the hardest to distinguish in the set.

Which emphasizes that, while it's good to start with a colorblind-friendly
set of colors, the person making the figure also has the responsibility to
choose how to use those colors carefully so that the categories that are
most important to distinguish aren't colored with red and green.

On Mon, Feb 16, 2015 at 3:32 PM, Eric Firing  wrote:

> On 2015/02/16 1:19 PM, Michael Waskom wrote:
>
>> Here are two palettes that are optimized for colorblindness:
>> http://www.cookbook-r.com/Graphs/Colors_%28ggplot2%29/#
>> a-colorblind-friendly-palette
>>
>>
> Strange--they have both red and green, so I would never have expected them
> to work.  The yellow looks too light to work well on a light background,
> especially for projecting slides.
>
> Eric
>
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-16 Thread Michael Waskom
See [here](http://nbviewer.ipython.org/gist/mwaskom/6a43a3b94eca4a9e2e8b)
for a quick and dirty implementation that should get a general idea. This
probably ins't the best way to do it -- anyone should feel free to build on
this.

On Mon, Feb 16, 2015 at 3:38 PM, Eric Firing  wrote:

> On 2015/02/16 1:29 PM, Michael Waskom wrote:
>
>  Nathaniel's January 9 message in that thread (can't figure out how to
>> link to it in the archives) had a suggestion that I thought was very
>> promising, to do something similar to Parula but rotate around the hue
>> circle the other direction so that the hues would go blue - purple - red
>> - yellow. I don't think we've seen an example of exactly what it would
>> look like, but I reckon it would be similar to the middle colormap here
>> http://earthobservatory.nasa.gov/blogs/elegantfigures/
>> files/2013/08/three_perceptual_palettes_618.png
>> (from the elegant figures block series linked above), which I've always
>> found quite attractive.
>>
>
> Certainly it can be considered--but we have to have a real implementation.
>
>
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-17 Thread Michael Waskom
Hey Olga,

On Tue, Feb 17, 2015 at 6:24 PM, Olga Botvinnik  wrote:

> Out of curiosity, what are the advantages of the HCL colormap over YlGnBu
> for continuous values? I'm biased towards YlGnBu because green is my
> favorite color and want to know what makes HCL objectively better for
> perceiving values.
>

Perceptually, the luminance ramp is probably a bit more linear, but that's
not a huge deal. The main functional advantage to using *some* kind of Hcl
based map is that it lets matplotlib tweak more parameters. This particular
Hcl map has a bit more hue variation than YlBuGn, and I think the
saturation channel is doing something different than what the colorbrewer
maps do. So it appears a little bit more "colorful", which I think was one
of the objectives.

I think there's some argument for matplotlib creating a novel colormap for
its default rather than just using one of the preset colorbrewer ones. It
would be nice to have a bit more well-defined visual identity, and having
people say "oh hey that's the matplotlib colormap, it looks really nice!"
might have good marketing benefits. I like the colorbrewer palettes and use
them often, but it seems kind of boring to take an existing colormap that
lots of packages have and make it the default.


> I added YlGnBu_r versions of those plots just below yours:
> http://nbviewer.ipython.org/gist/olgabot/6a619ef21c178801ff77
>
> It seems it's a little more "extreme" than HCL, as in it lights are
> lighter and its darks are darker. From the color research, is this less
> desirable?
>

Well, that could be changed in the Hcl version by setting different
endpoints for the lightness ramp. I was trying to get something similar to
parula, which doesn't cover as extreme of a lightness range and is more
saturated on both ends than the color brewer palettes. I would imagine the
reasoning for this is that it might let the map represent categorical or
divergent data a little bit better without much cost to sequential data,
but I am not sure.

Also, if you map a line or scatter plot with YlGnBu, the lightest colors
might not be visible on a white background, whereas I think the yellow I
used would be ok. This might be something to keep in mind as the map that
gets chosen will likely be the default for plt.scatter.

But like I said, I didn't spend much time thinking about exactly where the
endpoints should be, so it's possible one would want more dynamic luminance
range.

Michael


> On Mon Feb 16 2015 at 9:28:56 PM Benjamin Root  wrote:
>
>> Do remember that I have a PR to add linestyle cycling, which would
>> greatly mitigate problems for colorblindness and non-color publications.
>>
>> I also prefer it for slideshows as projectors at conferences tend to have
>> crappy colors anyway (was at a radar conference when the projector's red
>> crapped out while the presenter was building up suspense about the really,
>> really impressive radar image of a supercell on the next slide)
>>
>> Ben Root
>> On Feb 16, 2015 7:24 PM, "Michael Waskom"  wrote:
>>
>>> See [here](http://nbviewer.ipython.org/gist/mwaskom/6a43a3b94eca4a9e2e8b)
>>> for a quick and dirty implementation that should get a general idea. This
>>> probably ins't the best way to do it -- anyone should feel free to build on
>>> this.
>>>
>>> On Mon, Feb 16, 2015 at 3:38 PM, Eric Firing  wrote:
>>>
>>>> On 2015/02/16 1:29 PM, Michael Waskom wrote:
>>>>
>>>>  Nathaniel's January 9 message in that thread (can't figure out how to
>>>>> link to it in the archives) had a suggestion that I thought was very
>>>>> promising, to do something similar to Parula but rotate around the hue
>>>>> circle the other direction so that the hues would go blue - purple -
>>>>> red
>>>>> - yellow. I don't think we've seen an example of exactly what it would
>>>>> look like, but I reckon it would be similar to the middle colormap here
>>>>> http://earthobservatory.nasa.gov/blogs/elegantfigures/
>>>>> files/2013/08/three_perceptual_palettes_618.png
>>>>> (from the elegant figures block series linked above), which I've always
>>>>> found quite attractive.
>>>>>
>>>>
>>>> Certainly it can be considered--but we have to have a real
>>>> implementation.
>>>>
>>>>
>>>
>>>
>>> --
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your 

Re: [matplotlib-devel] release strategy and the color revolution

2015-02-18 Thread Michael Waskom
Cool! I knew there had been some useful tools posted on the earlier thread
but didn't have time to dig them out.

Interesting observation about the colorfulness. I don't know enough about
all the transformations involved to full account for that, but I added some
stuff to the notebook to figure out how much of that might be caused by
straying out of gamut. It looks like the map I created does a pretty good
job and is only getting clamped at the very low end and near the high end,
so I don't think it's a complete explanation for the undulating
"colorfulness":
http://nbviewer.ipython.org/gist/mwaskom/6a43a3b94eca4a9e2e8b

By means of disclosure, I did this before having coffee, so it might be
wrong...
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-18 Thread Michael Waskom
I've made a second notebook that uses the IPython interactive machinery to
let anyone play with the parameters and explore different ways of setting
them. you can download the notebook with that here:
http://nbviewer.ipython.org/gist/mwaskom/842d1497b6892d081bfb (I made it
using IPython 3.0rc1; I'm not certain if it will work on the 2.x series;
sorry if that is the case).

This stays with the general approach in the original notebook of using a
linear ramp for chroma, which again maybe is not what we want. But it
should let you get a better sense for the parameter space.

As I said in the email to Olga, I think (a) I would advocate fairly
strongly that matplotlib should design a custom colormap as its default,
and (b) I think this approach (a cubehelix-like map in Hcl space) is a
principled way of doing so (though maybe not optimal). But both of those
points are independent of whether you end up going with the particular
parameters that I used to generate the original proposal -- I have my own
domain on which to impose my personal aesthetic preferences, and I don't
need to take over matplotlib too :)

(But I do think it's worth distinguishing the matplotlib default from the
matlab default.)

Michael
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-18 Thread Michael Waskom
On Wed, Feb 18, 2015 at 4:42 PM, Olga Botvinnik  wrote:

> FYI the notebook isn't working for me in IPython 2.2.0
>

Oops, sorry.


> I agree with Michael's sentiment that from a marketing perspective, a
> matplotlib-only colormap is advantageous to maintain a consistent brand.
>

Just to be clear, I wasn't suggesting *matplotlib only* in the (legal)
sense that parula is matlab only, just that it should be identifiably "the
matplotlib colormap".


> Will these colormaps also be used for non-imshow/colormesh/pcolormesh
> data, as in for line colors as well? I think that's a great idea! It'll
> make the black and white versions easier to understand since the changing
> colors will monotonically increase/decrease in darkness rather than
> randomly changing.
>

I wasn't really thinking the plt.plot line cycle, more about plt.scatter,
plt.contour, etc. and other places that accept a cmap argument but don't
draw an "image-like" plot. Though, having a default colormap that can be
used when you want to encode a quantitative value in the color of lines,
e.g. the figures here:
http://www.machenslab.org/publications/machens_etal_2010.pdf, would be good
too. That's somewhere you often find people using jet.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release strategy and the color revolution

2015-02-18 Thread Michael Waskom
On Wed, Feb 18, 2015 at 5:23 PM, Eric Firing  wrote:

>
> Do you think there is a way to make a sequential map that is more pleasing
> to those of us who are more comfortable with blues and greens than with the
> slightly muddy purples and browns in the initial attempt at HCL?


Just to be clear, Hcl is just a color space; you could in principle make
any number of colormaps using it. My particular proposal is to do something
cubehelix-like in Hcl space while aiming for around .5-.75 of a rotation
around the color wheel. What motivated the particular parameters in the
original proposal was two things:

a) Starting with blue and ending with yellow makes sense, because you can
get good saturation out of dark blues and light yellows
b) Once you have those endpoints, you can either go through green (this is
what matlab does with parula) or through purple and red. the latter has the
functional advantage of getting a bit more hue variation, and it also
distinguishes the colormap from parula. I think this was the argument
Nathaniel originally made.

Tastes differ, but I find the blue-purple-red-yellow colormap quite
attractive, (perhaps because it reminds me of the sunset. Actually, as an
aside, your speculation that your aesthetic preferences are driven by
positive associations by things that have those colors has some support in
the psych literature: http://www.pnas.org/content/107/19/8877.full)

Anyway, within the constraints of the "increase lightness and chroma
linearly while circling around the hue wheel", it's easy to create a
blue-green-yellow colormap:



​


And also more generally, once you have a way of making a colormap from a
few parameters, and some objective function for what makes a colormap
"good", you can optimize in more principled ways than just playing around
with the knobs of a widget. I believe this is what Nathaniel was proposing,
and it sounds like a good idea.

I would suggest that you folks (i.e. the matplotlib core developers) figure
out earlier, rather than later, how the actual decision is going to be
made. I think you can get pretty far with principled arguments, but
ultimately there's going to be an aesthetic aspect and the decision will
easily devolve some people thinking option A is "ugly" and other people
thinking option B is "ugly". And that will be annoying for everyone
involved, but particularly for the people who put time into developing
candidates.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Travis build of development matplotlib?

2015-08-29 Thread Michael Waskom
Hi all,

I would like to set up a Travis build of seaborn that tests against the
development version of matplotlib. Ideally this would happen without
actually compiling matplotlib on Travis, to save time.

Does matplotlib master get packaged such that it is installable through
conda? I thought I recalled seeing this somewhere, but I am having trouble
digging it up.

Thanks!
Michael
--
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel