I have a set of data that contains 3d Cartesian points (x, y, z) and a time stamp.
I would like to plot this data as a connected line in 3d space with the line colour changing based on the time stamp value.
Effectively i want to show the time difference in a colorbar.
Does anyone know of a way to do this?
Consider the following example of a 3D point moving along a helix-shaped path over time:
Now if you want to draw a multi-colored line, the naive solution would be to write a for-loop, drawing each small segment as a separate line, each having a different color. This is because a single line object can only have one color.
A better approach is to use a surface graphics object:
The result: