# Apply different PlotStyles to functions with functions as variable [closed]

I have a function func[expr,var] with which I want to plot the list expr[var] and have different styles applied to it. When doing this with ListPlot, it works, but somehow this just gives the plot with the first PlotStyle given.

To be specific:

func[expr_, var_] := Module[{f}, f[x_] := Evaluate[expr /. var -> x]; Plot[f[x], {x, 0, 10}, PlotStyle -> {{Red}, {Black}}]]

This gives the plot of Sin[x] and Sin[2x] both in red. How do I get one the first expression in red and the second in black?

• Why not just func[expr_, var_] := Plot[expr, {var, 0, 10}, PlotStyle -> {{Red}, {Black}}]? – J. M. will be back soon Mar 31 '19 at 22:48
• True :'D I must've somehow come to the conclusion that this would not work for some reason. Now I changed quite a bit in the structure and this seems to work again. Thanks – Innerw0lf Mar 31 '19 at 22:52

Keep f as a list of functions, rather than a new function f[x].
func[expr_, var_] := Module[{f, x},