I want to plot a function of 2 variables x and y, for discrete values of y, like:
myFunc[x_, y_] := Sin[x y]
yvalues={0.1,0.5,1.0,2.0}
Plot[Evaluate@Map[myFunc[x, #] &, yvalues], {x, 0, 5}]
What I want is that the maximum x range (in this case 5) is a function of yvalues, for example, for each value i of yvalues, stop the corresponding plot curve at Cos[yvalues[[i]]].
I need this because in my real case, the function to plot is a 2D interpolation which behaves badly outside some specific intervals depending on y.
Thanks.




If,Piecewise,Booleand more to your definition ofmyFunc. – b.gates.you.know.what Aug 19 '14 at 09:46Table[Plot[Sin[x i], {x, 0, i}], {i, 1, 5}] // Show[#, PlotRange -> All] &– chris Aug 19 '14 at 10:10tt = {Sin[x], Cos[x], Cos[2 x]}; gg = {{0, 1}, {0, 2}, {0, 3}}; MapThread[Plot[#1, Evaluate@{x, Sequence @@ #2}] &, {tt, gg}]//Show– chris Aug 19 '14 at 10:13gg = {Table[{x, Sin[x]}, {x, 0, 10}] // Interpolation, Table[{x, Cos[x]}, {x, 0, 20}] // Interpolation}; Plot[#[x], {x, #[[1, 1, 1]], #[[1, 1, 2]]}] & /@ gg // Show– chris Aug 19 '14 at 10:15Evaluated->TrueorEvaluate– Santiago Aug 19 '14 at 10:26Table[Plot[Sin[x i], {x, 0, 5 + i}, PlotStyle -> ColorData[10][i]], {i, 1, 3}] // Show[#, PlotRange -> All] &which is basically the same as eldo – chris Aug 19 '14 at 10:53