Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

Cheers!

share|improve this question
1  
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

1 Answer 1

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 –  belisarius Nov 8 '13 at 16:20

Your Answer

 
discard

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.