I used to use the StringForm / StringJoin varieties shown above ... but I think that a neater way is now to use Defer (since v6). This also has the advantage that it will generate your plot label in fancy TraditionalForm (unlike the other solutions posted here) ... because it is not a string:
testplot[a_, i_] := Plot[i x^2, {x, 0, 3}, PlotLabel -> Defer[a = i]]
Example:
testplot[b, 3]
=================================================================================
Update:
In a helpful comment below, @Mr.Wizard suggests that it may be better to use HoldForm than Defer, because if an end-user evaluates the plot as input, the Defer will get activated. Just to clarify, if our plot is AA = Plot[blah …], then Show[AA] will NOT activate the Defer. But it will happen if the user inadvertently (or otherwise) places the cursor in the plot output in the front-end, and then evaluates that graphical output as input … which could possibly happen by mistake or error.
Taking on the advice of MrWizard, I proceeded to change my code to HoldForm. MUCH TO MY SURPRISE … HoldForm caused MORE assignment problems than Defer did. For example, starting from a fresh kernel:
lis = {0, 1, 2};
Plot[Evaluate[x+lis], {x,0,1},
PlotLegends -> Map[TraditionalForm[HoldForm[p = #]]&, lis]]
produces a nice Plot with appropriate legends, but then … shock --- horror … if you then evaluate p, look what has happened to it using HoldForm:
p
2
Clear[p];
OUCH! This does not happen with Defer. This must be some sort of bug. The TraditionalForm is needed to make the labels present 'nicely'. One way to work around this apparent bug is to wrap the TraditionalForm just around the p:
Plot[Evaluate[x+lis], {x,0,1},
PlotLegends -> Map[HoldForm[TraditionalForm[p] = #]&, lis]]
and then p is not evaluated, and it works correctly. [Obviously, I am avoiding the String versions because TraditionalForm output is desired.]
PlotLabel->("a="<>ToString[a])
? $\endgroup$