Function of interest:
f[n_, r_] := (1 - r^2)^((n - 4)/2)/(Beta[1/2, (n - 2)/2])
In separate graphs:
Table[ Plot[f[n, r], {r, -1, 1}, Frame -> True, GridLines -> Automatic, PlotLegends -> "Expressions" ], {n, 4, 19}]
Now if I do
Plot[Table[f[n, r], {n, 4, 19}], {r, -1, 1}, Frame -> True, PlotLegends -> "Expressions" ]
This gives no Legends. Then I try
tmp = Table[f[n, r], {n, 4, 19}]
Plot[tmp, {r, -1, 1}, Frame -> True, PlotLegends -> "Expressions" ]
It works fine, but not exactly the legends I want. How can I have legends with specific values of n
and r
, like f(8,r)
, or f(4,r)
, or anything that is more informative?
Plot[tmp, {r, -1, 1}, Frame -> True, PlotLegends -> Table["f(" <> ToString[n] <> ",r)", {n, 4, 19}] ]
This is also ok, but is can I do it without introducing the exatra tmp
variable? There must be a more efficient way.
Thanks.