Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of ODEs I am solving, and then plotting (several) trajectories of in ParametricPlot3D. I want to have a color of each plot reflect the time (i.e. the Parameter) at that point.

I tried what something along the lines of:

ParametricPlot3D[{{Sin[t], Cos[t], t/10}, {Sin[2*t], 3*Cos[t], Tan[t]}}, {t, 0, 20},
ColorFunction -> Function[t, Hue[t]]]

which colors the function in a seemingly arbitrary way.


share|improve this question
Look in the details section too see what arguments are given to the ColorFunction. Function[{x, y, z, t}, ...] – ssch Nov 8 '13 at 14:25
ParametricPlot3D[{{Sin[t], Cos[t], t/10}, {Sin[2*t], 3*Cos[t], Tan[t]}}, {t, 0, 2 Pi}, 
                 ColorFunction -> Function[{x, y, z, t}, Hue[t]], 
                 PlotStyle -> Thick,
                 Exclusions -> Thread[Equal[t, Array[(2 # - 1)/2 Pi &, 2]]]]

Mathematica graphics

share|improve this answer
Please note that extending the plot till t == 20 as you've done will cause the second function to plot along the same path several times, so occluding the "real" coloring – Dr. belisarius Nov 8 '13 at 16:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.