currently I am trying to plot for the Legendre polynomial $P_n(x)$ for $n=0,1,2,3,4$ and $-1 \leq x \leq 1$ .
To plot for it, I wrote the following code:
MyLegendre=Table[[LegendreP[v,x],x],{n,0,4}]; Plot[MyLegendre,{x,-1,1},PlotLabels -> {"v=0", "v=1", "v=2", "v=3", "v=4"}]
However, Mathematica keeps stating that there is an error with my above code. Any help to resolve this problem would be greatly appreciated. Thank you for the help!
MyLegendre = Table[LegendreP[v, x], {v, 0, 4}]; Plot[ MyLegendre // Evaluate, {x, -1, 1}, PlotLabels -> {"v=0", "v=1", "v=2", "v=3", "v=4"}]
$\endgroup$