[SciPy-user] Getting an RGB value from a colormap

mike cantor mcantor at stanford.edu
Tue Mar 7 14:37:24 CST 2006


Hi,

I'd like to use the colormap interface in a different way than it's used in 
plotting images.  I am plotting a series of curves (using regular old 
plot), each of which corresponds to the behavior of a biological circuit 
under a different level of "inducer", ranging from around 0-100.  I want to 
assign the color of each line according to the inducer value, and I want to 
try out different colormaps to see which I like best.

All I really want is a method that, for a given colormap (jet, pink, hot, 
hsv, etc), takes a number between 0,1 as input and returns the 
corresponding RGB value, which I can then use a 'color' argument in a 
plotting command.  (I was sort of hoping that the colormap object itself 
would provide such a method but I couldn't find any description of it's 
interface).

Any ideas?
Thanks,
-mike



More information about the SciPy-user mailing list