getting colors from the discrete color bar

Hello everyone!

I want to extract colors from the colormap

example:
     import matplotlib.cm as cm
     color1=cm.jet(20)

Now I need to get colors from the discrete colorbar
there is a working code how to create discrete colormap:
http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations Discrete
colormap

I make same thing with:
    newcbar=cmap_discretize(cm.jet,100) # jet is devided by 100 parts
    color2=newcbar(20)

surprisingly color2 is different than color1. I dont understand why.

Could you please give me an idea how to create a discrete colorbar and
extract color?

···

--
View this message in context: http://old.nabble.com/getting-colors-from-the-discrete-color-bar-tp31559720p31559720.html
Sent from the matplotlib - users mailing list archive at Nabble.com.