# Plot multiple lines with colour and legends [duplicate]

This question already has an answer here:

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.

## marked as duplicate by corey979, m_goldberg plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 26 '18 at 8:27

Plot[Evaluate @ Table[f[n, r], {n, 4, 19}], {r, -1, 1}, Frame -> True,
PlotLegends -> Table["f(" <> ToString[n] <> ",r)", {n, 4, 19}]] You can also use

 PlotLegends -> Table[Inactivate @ f[n, r], {n, 4, 19}] (* or *)
PlotLegends -> (TraditionalForm @ Defer@f[#, r] & /@ Range[4, 19])


to get the same result.