I have a list of functions
that I want to plot on the same figure. I want each line to have an opacity function that is defined by the list weights
. In addition I want each colour of the line to be chosen in order from a colour scheme. My attempt:
parameters = Range[1, 5];
nParam = Length[parameters];
functions = # x & /@ parameters;
weights = Cos[# x]^2 & /@ parameters;
colorFunctions = Table[Opacity[weights[[n]], ColorData["Rainbow"][(n - 1)/(nParam - 1)]], {n, 1, nParam}]
Plot[functions, {x, 0, Pi}, ColorFunction -> colorFunctions]
How do I achieve my goal?