Hi,
I forgot to say that this works of course also if you want to add legends.
M = 10; data = RandomReal[1, M];
Manipulate[
Show[ListPlot[data, PlotStyle -> Red],
Plot[Evaluate[
Normal[NonlinearModelFit[data,
Evaluate[Sum[Subscript[a, i] x^i, {i, 0, d}]],
Evaluate[Table[Subscript[a, i], {i, 0, d}]], x]]], {x, 0,
M + 1}, PlotRange -> All ,
PlotLegends ->
Placed["Polynomial \nf(x)=" <>
ToString[
TraditionalForm[
Evaluate[
Normal[NonlinearModelFit[data,
Evaluate[Sum[Subscript[a, i] x^i, {i, 0, d}]],
Evaluate[Table[Subscript[a, i], {i, 0, d}]], x]]]]],
Below]]], {d, 0, 10}]
Cheers,
M.