encoding 2 variables with hue / intensity

Is there any way to encode 2 variables in a matplotlib colormap? The idea is to replicate this dataspora R scatterplot in matplotlib:

http://www.dataspora.com/gameday/pitcher/daisuke-matsuzaka/493137

"The bottom strip of charts encode two dimensions with color – blue or red hue indicates pitch velocity – while the lightness or darkness of the hue indicates how many pitches were thrown in a given region. "

···


Peter N. Skomoroch
617.285.8348
http://www.datawrangling.com
http://delicious.com/pskomoroch
http://twitter.com/peteskomoroch

I don't think there's anything that will directly do what you want.

However, you can provide a list of colors (one entry for each point) to scatter(), (the c kwarg) so you can generate your colors however you need to beforehand. If you come up with a solution that's generic enough, we would definitely consider it for inclusion in matplotlib.

Cheers,
Mike

Peter Skomoroch wrote:

···

Is there any way to encode 2 variables in a matplotlib colormap? The idea is to replicate this dataspora R scatterplot in matplotlib:

http://www.dataspora.com/gameday/pitcher/daisuke-matsuzaka/493137

"The bottom strip of charts encode two dimensions with color -- blue or red hue indicates pitch velocity -- while the lightness or darkness of the hue indicates how many pitches were thrown in a given region. "

--
Peter N. Skomoroch
617.285.8348
http://www.datawrangling.com
http://delicious.com/pskomoroch
http://twitter.com/peteskomoroch
------------------------------------------------------------------------

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Mike,

Thanks for the tip, I was also thinking of using some kind of nonlinear transform onto a 1D segmented colormap… I’ll let you know if I come up with a solution.

-Pete

···

On Tue, Mar 3, 2009 at 8:27 AM, Michael Droettboom <mdroe@…86…> wrote:

I don’t think there’s anything that will directly do what you want.

However, you can provide a list of colors (one entry for each point) to scatter(), (the c kwarg) so you can generate your colors however you need to beforehand. If you come up with a solution that’s generic enough, we would definitely consider it for inclusion in matplotlib.

Cheers,

Mike

Peter Skomoroch wrote:

Is there any way to encode 2 variables in a matplotlib colormap? The idea is to replicate this dataspora R scatterplot in matplotlib:

http://www.dataspora.com/gameday/pitcher/daisuke-matsuzaka/493137

"The bottom strip of charts encode two dimensions with color – blue or red hue indicates pitch velocity – while the lightness or darkness of the hue indicates how many pitches were thrown in a given region. "

Peter N. Skomoroch

617.285.8348

http://www.datawrangling.com

http://delicious.com/pskomoroch

http://twitter.com/peteskomoroch



Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA

-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise

-Strategies to boost innovation and cut costs with open source participation

-Receive a $600 discount off the registration fee with the source code: SFAD

http://p.sf.net/sfu/XcvMzF8H



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Michael Droettboom

Science Software Branch

Operations and Engineering Division

Space Telescope Science Institute

Operated by AURA for NASA


Peter N. Skomoroch
617.285.8348
http://www.datawrangling.com
http://delicious.com/pskomoroch

http://twitter.com/peteskomoroch