1
$\begingroup$

Suppose I have a function f[x_,t_]=Sin[10*x-2*t] and I want to plot f vs x for different values of t on the same plot window.

I have tried with Table command but its showing in different plot windows.

Here is the code

f[x_, t_] = Sin[10*x - 2*t];
Table[Plot[f[x, t], {x, 0, 1}, PlotRange -> All], {t, 0, 10}]

Also I would like to plot it with different colors.

Thanks

$\endgroup$
0
2
$\begingroup$

Put the Table inside the plot and use Evaluate

f[x_, t_] = Sin[10*x - 2*t];
Plot[Evaluate[Table[f[x, t], {t, 0, 10}]], {x, 0, 1}, 
 PlotRange -> All]

Mathematica graphics

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.