Hi, I once was indicated a way to extract colors from exsiting colormaps:

I just answered a question on Stackoverflow and maybe you can have a look.

all code in pylab mode

a = np.arange(100).reshape(10,10)
#here is the image with white and black end
imshow(a,cmap=mat.cm.binary)
colorbar()

#we extract only the 0.2-->0.7 part of original colormap and make a new one
#so that the white and black end are removed
rgba_array = mat.cm.binary(np.linspace(0,1,num=10,endpoint=True))
extract_rgba_array_255 = rgba_array[2:8,0:3]
imshow(a,cmap=mat.colors.ListedColormap(extract_rgba_array_255))
colorbar()

cheers,

Chao




--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/colormap-shift-tp39660p39707.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to