# How to make a Tooltip display dynamic based on a parameter value?

If k=3, then I would like the following to say "Sine Curve, k=3" when you hover over the output of the Tooltip command:

Tooltip[Sin[k*x], "Sine Curve, k=", TooltipStyle -> FontSize -> 16]


I have made a number of attempts, using pure functions and substitutions, but none delivered the output I want. The ultimate goal is to put this into a Manipulate where k is a user selectable value and the Sin[k x] function is plotted.

-

String manipulation like in jVincent's answer is nice, but I normally prefer to combine these types of elements using Row:

Manipulate[
Plot[Tooltip[Sin[k x], Row[{"Sine Curve, k=", k}]], {x, 0, 4 Pi}],
{k, 1, 5}]


For more complicated objects, it just normally ends up being neater. Maybe my preference comes from having to work with RowBox and MakeExpression too much...
Aside: I would also use "\[VeryThinSpace]\[LongEqual]\[VeryThinSpace]" instead of just "=",
it looks nicer:

and in Mathematica, "=" is normally associated with Set.

-
Thank you, I do like the way this looks. Especially when you are presenting larger fonts on a projector screen! – Joseph Jan 6 '13 at 14:42

You can insert the value into the tooltip using ToString:

Manipulate[
Plot[Tooltip[Sin[k x], "Sine Curve, k=" <> ToString[k]], {x, 0, 4 \[Pi]}],
{k, 1, 5}]

-
This is exactly I was looking for, Thank you very much! – Joseph Dec 21 '12 at 20:10