I'm helping my students with parametrization. I tried to change the color on the second rotation of the unit circle with this code:
Manipulate[
ParametricPlot[{Cos[2 t], Sin[2 t]}, {t, 0, tau}, PlotRange -> 1.2,
PlotStyle -> {If[t <= π, "Blue", "Red"]}],
{{tau, 0.1}, 0, 2 π}]
But it remains blue after the first rotation. Can someone make a suggestion how to change the color?
Blue
andRed
; colors are keywords in Mathematica mostly; see alsoGrayLevel
,Hue
, andRGBColor
. Also, the parametert
is not defined generally outside of the first argument to the function; you should look at theColorFunction
option. $\endgroup$ – nben Jan 31 '17 at 19:28