# PlotLegends for parameter steps in ParametricNDSolve

Given:

sol = ParametricNDSolve[{y'[t] == a y[t], y[0] == 1},
y, {t, 0, 10}, {a}]

Plot[Evaluate[Table[y[a][t] /. sol, {a, -1, 1, .1}]], {t, 0, 1},
PlotRange -> All]


How can I make the legend show the correspondence of an individual curve to the corresponding parameter value?

Plot[Evaluate[Table[Legended[y[a][t], a] /. sol, {a, -1, 1, .1}]]
, {t, 0, 1}, PlotRange -> All]


Plot[Evaluate[Table[Callout[y[a][t], a] /. sol, {a, -1, 1, .1}]]
, {t, 0, 1}, PlotRange -> All]


EDIT

To answer the question in the comment, here are some ways to add the text "a=" at different locations. There are really a lot of possibilities to tune this layout, so I may miss something better :

Plot[Evaluate[
Table[Legended[y[a][t]
, Row[{HoldForm[a], " = ", a}]] /.
sol, {a, -1, 1, .1}]], {t, 0, 1}, PlotRange -> All,
PlotLegends ->
LineLegend[Expression, Automatic, LegendLabel -> "a = ..."]]


• Cool ! But how to write not just numbers, but $a=...$
– ayr
Commented Aug 20, 2021 at 6:15
• you want "a=..." repeated 20 times ? or only once somewhere ? Commented Aug 20, 2021 at 6:18
• show both options , I will then decrease the plot and put the graph in order, I just want to understand the principle
– ayr
Commented Aug 20, 2021 at 6:22
• See my Edit. I can't do more at the moment. Commented Aug 20, 2021 at 6:46
• This is a good result, it suits me. Thank you so much for your help!
– ayr
Commented Aug 20, 2021 at 6:50