# Parametric Plot - Opacity Changing Along Line

How would one have the trajectory in a parametric plot go from a higher to lower opacity? Suppose the following code for example:

Manipulate[ParametricPlot[{Cos[f1 t], Sin[f1 t]},
{t, 0, 4 π}, PlotRange -> 2, PerformanceGoal -> "Quality"],
{{f1, -0.3, "Frequency 1"}, -2 π, 2 π}]


This would show a circle. The goal is to show the line as a 'faded track' to represent the time progression, as opposed to a boring ol' solid line. I tried adding Opacity[t/(4 π)] to the plot options, which unsurprisingly failed.

Manipulate[ParametricPlot[{Cos[f1 t], Sin[f1 t]}, {t, 0, 4 Pi},
PlotStyle -> Thickness[.01],
ColorFunction -> (Opacity[1 - #3/ 4 / Pi, Red] &),
ColorFunctionScaling -> False, PlotRange -> 2,
PerformanceGoal -> "Quality"],
{{f1, -0.3, "Frequency 1"}, -2 Pi, 2 Pi}]


Or use

 ColorFunction -> (Opacity[#3/ 4/Pi, Red] &)


to get

• What does Opacity[1 - #3/ 4 / Pi, Red] & mean? I don't understand the argument nor the ampersand – Captain Morgan Aug 10 '18 at 21:23
• @CaptainMorgan See Function and ColorFunction in the documentation. – Mr.Wizard Aug 10 '18 at 21:31
• @CaptainMorgan, for ParametricPlot that produces a curve (two argument form: ParametricPlot[{$f_x$, $f_y$}, {$t$ ,$t_{min} , t_{max}$}] ) the settings for option ColorFunction can be functions that take three arguments (x, y and t). The function Opacity[1 - #3/ 4 / Pi, Red] & is the same as Function[{x,y, t}, Opacity[t/4/Pi, Red]]. – kglr Aug 10 '18 at 21:33
• @kglr, so the #3 is effectively t. Where is this referenced from? Would #2 be y such that the trajectory would instead change opacity based on height? Also, I see that in the documentation that & points to the function argument (I think?) I don't understand its role though here. Nothing follows it. – Captain Morgan Aug 10 '18 at 21:56
• @CaptainMorgan, you are right, #n refers to the $n$th argument. See Slot (#) in the documentation. you can define a function in a number of ways: For example, f1 = Function[{x, y, z}, x + 2 y + 3 z];f2 = (# + 2 #2 + 3 #3) &; f3[x_, y_, z_] := x + 2 y + 3 z are alternative ways of defining the same function, and f1[a, b, c],f2[a, b, c] and f3[a, b, c] all give a + 2 b + 3 c. – kglr Aug 10 '18 at 22:25