On Sun, Aug 21, 2011 at 05:58:18PM +0200, Markus Schütz wrote:
> from enthought.mayavi import mlab
> x = [0,0.0,0.5,1]
> y = [0,1.0,0.5,1]
> z = [0,0.0,0.5,1]
> s = [.8, .7, .5, .2]
> colmap = [(0,0,0,255),(0,255,0,255),(0,0,255,255),(255,255,0,255)] 
> #black, green, blue, yellow

> mol = mlab.points3d(x, y, z, s, scale_factor=1)
> mol.module_manager.scalar_lut_manager.lut.table = colmap

> mlab.show()

> The problem is that the order is inverted (the biggest point should be 
> black)

Then just invert your colormap.

> and that only 3 colors are used. What I'm doing wrong?

Mayavi treats the scalar value as a continuous variable, and thus finds
the closest matching color in the LUT. Your scalar values range from .2
to .8, with 4 LUT points, the capture ranges of these points are
something like [.2, .3.5[, [.35, .5[, [.5, .65[, [.65, .8]. You can see
this by plotting your colorbar:

mlab.colorbar(nb_labels=21)

To get what you want, you can tweak a bit either the number of colors
that you put in your LUT, or the vmin/vmax range in the points3d command.

HTH,

Gael


------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to