Search code examples
pythonlinesmayavi

Draw multiple lines with specific line color in Mayavi


I followed http://docs.enthought.com/mayavi/mayavi/auto/example_plotting_many_lines.html to draw multiple point-to-point lines in 3D. It works, but i need to color each of the lines according to some scalar value.

How can i assign such a scalar value on a line-per-line basis?


Solution

  • The tutorial you linked does use scalars to specify the line colors (using the "accent" map). When calling mlab.pipeline.scalar_scatter(x,y,z,s), scalars go in s.

    Did you mean to ask something more?