Plot[Sin[2 x]^2 Cos[1/2 x]^2, {x, 0, 2 \[Pi]},
ColorFunction -> (Blend[{Blue, Yellow}, #2] &),
ColorFunctionScaling -> False,
GridLines -> Automatic,
PlotStyle -> {{Thickness[0.008], AbsoluteDashing[{15, 4, 4, 5}]}}]
Some other possibilities:
Plot[Sin[2 x]^2 Cos[1/2 x]^2, {x, 0, 2 \[Pi]},
ColorFunction -> Function[{x, y}, If[y > 0.2, Red, Black]],
ColorFunctionScaling -> False,
GridLines -> Automatic,
PlotStyle -> {{Thickness[0.008], AbsoluteDashing[{15, 4, 4, 5}]}}]
Plot[Sin[2 x]^2 Cos[1/2 x]^2, {x, 0, 2 \[Pi]},
ColorFunction -> Function[{x, y}, GrayLevel@y],
ColorFunctionScaling -> False,
GridLines -> Automatic,
PlotStyle -> {{Thickness[0.008], AbsoluteDashing[{15, 4, 4, 5}]}}]
Plot[Sin[2 x]^2 Cos[1/2 x]^2, {x, 0, 2 \[Pi]},
ColorFunction -> "DarkRainbow",
ColorFunctionScaling -> False,
PlotStyle -> {{Thickness[0.008], AbsoluteDashing[{15, 4, 4, 5}]}}]