Let's say I want to use the following command to plot the following line segments defined by the points:
Graphics3D[Line[{{1, 1, -1}, {2, 2, 1}, {3, 3, -1}, {4, 4, 1}}]]
How do I make it so that each line segment has a different color? This is just an example but I would want to be able to do it with arbitrarily many points/line segments.
Thanks in advance!
Line
primitives. What you can do with a single line is assign a different colour to each vertex, and let the system interpolate between them along the segments. It's theVertexColors
option. $\endgroup$