I'm looking to do something similar to the below image (source) in Matlab. Ignore the vectors and the shaded cone; I just want to
- plot a trajectory on the unit sphere, given by a function
m(x)(whose values are points on the sphere), - color it according to parameter
x(running from-infto+inf), - display a color bar which explains the mapping from
x-value to color.
I can plot the sphere easily with the help of built-in functions sphere and mesh, and I can draw the trajectory with plot3. To generate the x-values I can use something like
x = tan((-1:0.01:1)*pi/2);
which gives a distribution of points fitting for the types of functions m(x) will be (most of the action will be around x = 0).
The tricky part is the color. I have looked at the colormap and colorbar built-ins, but both seem to pertain to meshes and surfaces rather than curves, so I don't see an obvious way to adapt it to my use case.
Does anyone have any ideas for how I might proceed?
