Hello I am trying to calculate the facecolors for the Axes3D.plot_surface function, to have something similar to matlab surf 4th argument!! Something like plot_surface(x,y,z,facecolors=calc_colors(v))
So, I need to obtain the colors corresponding to the values of v! I created the function calc_colors: import pylab import numpy as np from matplotlib.colors import rgb2hex def calc_colors(var): colors = np.empty(var.shape, dtype='S7') mm=pylab.cm.ScalarMappable() mm.set_clim((var.min(),var.max())) mm.set_cmap(pylab.cm.jet) colors.flat= [rgb2hex(mm.to_rgba(k)[:-1]) for k in var.flat] return colors Well I believe this is not the smartest way to calculate the colors !! At least it is quite slow ! Can someone give me a better solution for this problem? than you mma ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users