Am 04.10.2010 12:04, schrieb James Brown:
> Is there a way to extract the value of a variable and display it with
> Tooltip?
> Example:
> f[x_] := 1/x^2
> Plot[Tooltip[f[x],"Value of x is:" "(wish I knew)"],{x,0,100}]
>
I think this should get you going:
Dynamic[CurrentValue[{"MousePosition", "Graphics"}]]
I found it works better to only extract the first value and calculate
the function value with that, otherwise the difference can become
irritating:
Plot[Tooltip[f[x],
Dynamic[{#, f[#]} &@CurrentValue[{"MousePosition", "Graphics"}][[1]]
]], {x, 0, 100}]
hth,
albert