This is related to a previous question I had about colormaps;
Im looking for a method to evenly split up a colormap into an RGB colors array.
something like:
def cmap_to_array(cmap,N):
...
mycolors=cmap_to_array(cm.jet,20)
lev=np.arange(1,20,1)
cs=contourf(Z,lev,colors=mycolors)
...
where 'mycolors' would be a 20x3 array with RGB values for 20 colors that represent the cm.jet spectrum broken up evenly into 20 colors...
I believe colors array can contain RGB tuples, something like [[0.2,0.3,1],[0.3,0.5,1], ... ,[1,1,0]] should work.
However, I dont know how to extract the tuples from an existing colormap.
How can this be done?
Please help...
Thanks,
P.Romero
···
_________________________________________________________________
Windows Live™ Groups: Create an online spot for your favorite groups to meet.
http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009