# Tooltip in Prolog and Epilog

I have a question concerning Tooltip. I got a ParametricPlot and included two pictures and a dynamic point.

I try to use Tooltip for each of those 2 Objects. But it doesn't work. I am not quite sure, how to include the command in my code.

arenstorf[y10_,y20_,y30_,y40_,mu_,tend_,ein_]:=Block[{problem,solArens,out},

problem= {y1'[t] == y2[t],
y2'[t] ==
y1[t] + 2*y4[t] -
(1-mu)*(y1[t] + mu)/((y1[t] + mu)^2 + (y3[t])^2)^(3/2) -
mu*(y1[t] - (1-mu))/((y1[t] - (1-mu))^2 + (y3[t])^2)^(3/2),
y3'[t] == y4[t],
y4'[t] ==
y3[t] - 2*y2[t] -
(1-mu)*(y3[t] )/((y1[t] + mu)^2 + (y3[t])^2)^(3/2) -
mu*(y3[t] )/((y1[t] - (1-mu))^2 + (y3[t])^2)^(3/2),
y1[0] == y10,
y2[0] == y20,
y3[0] == y30,
y4[0] == y40};

solArens = NDSolve[problem,
{y1, y2, y3, y4},
{t, 0, tend}];

out= {ParametricPlot[
Evaluate[{y1[t],y3[t]}/.solArens],{t,0,tend},
Frame->False,PlotPoints->40,
Epilog->
{PointSize[0.02],Black,Tooltip[Point/@({y1[ein],y3[ein]}/.solArens),
"Satellit"]},
Prolog ->  {
Texture[erde],
Polygon[{{-mu-.03, -.03}, {-mu+.03, -.03}, {-mu+.03,.03},
{-mu-.03, .03}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}
]}
] };
Return[out]]

Manipulate[arenstorf[0.994,0,0,-2.1139 ,0.012277471,5.4368,zeit],{zeit,0,5.4368}]

The point should move dynamically in the plot. Could anybody help me?

Thanks

• There are several undefined variables in your code block. Please add values for these, or, even better, modify the code to be a minimal working example for your problem. The easier it is for others to replicate the issue the more likely you'll get some help. Jan 9, 2016 at 11:52
• Thank you, I will change the code to a working example. Jan 9, 2016 at 15:39
• @BobHanlon now it is really working. Sorry! Jan 9, 2016 at 16:39

I added the Tooltip to the Prolog and added satellite location to Tooltip in Epilog. I cleaned up the code a bit by removing unnecessary parts. To see the Tooltip you must put the pointer over the object. To see the Texture the ImageSize must be very large.

erde = ImageCrop[
Import[
49f9-b20d-c3cef7fd7087.jpg"
]];

arenstorf[y10_, y20_, y30_, y40_, mu_, tend_, ein_] :=
Block[
{problem, solArens, pt},
problem = {
y1'[t] == y2[t],
y2'[t] == y1[t] + 2*y4[t] - (1 - mu)*(y1[t] + mu)/
((y1[t] + mu)^2 + (y3[t])^2)^(3/2) -
mu*(y1[t] - (1 - mu))/((y1[t] - (1 - mu))^2 + (y3[t])^2)^(3/2),
y3'[t] == y4[t],
y4'[t] == y3[t] - 2*y2[t] - (1 - mu)*(y3[t])/
((y1[t] + mu)^2 + (y3[t])^2)^(3/2) -
mu*(y3[t])/((y1[t] - (1 - mu))^2 + (y3[t])^2)^(3/2),
y1[0] == y10, y2[0] == y20, y3[0] == y30, y4[0] == y40};
solArens = NDSolve[
problem, {y1, y2, y3, y4}, {t, 0, tend}][[1]];
(*  [[1]] removes outer list brackets  *)
ParametricPlot[
{y1[t], y3[t]} /. solArens,
{t, 0, tend},
Frame -> False,
PlotPoints -> 40,
Epilog -> {PointSize[0.02], Black,
Tooltip[
Point[pt = {y1[ein], y3[ein]} /. solArens],
"Satellit\n" <> ToString[pt]]},
Prolog -> {
Texture[erde],
Tooltip[
Polygon[{{-mu - .03, -.03}, {-mu + .03, -.03},
{-mu + .03, .03}, {-mu - .03, .03}},
VertexTextureCoordinates ->
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
"Erde"]},
ImageSize -> 2000 (* large ImageSize needed to see Texture in Prolog *)]]

Manipulate[
arenstorf[0.994, 0, 0, -2.1139, 0.012277471, 5.4368, zeit],
{zeit, 0, 5.4368, Appearance -> "Labeled"}]
• Hello, I tried the following: Epilog->{PointSize[0.02],Black,Tooltip[Point[#], "Satellit"]&/@({y1[ein],y3[ein]}/.solArens)} but it doesn't work. Is your example working for a set of point or for a "dynamic point" too? I gues I don't quite understand the part "& /@ pts".. Jan 9, 2016 at 15:34
• Sorry, I answered your question before editing the code. Now my example is working. I hope my question get clearer now :) Jan 9, 2016 at 16:05
• Thanks for all your effors @BobHanlon. Does this code work on your machine? I tried it out on Mathematica Online and the Tooltip-option didn't work. I'll try it out on another machine tomorrow and will report, if it was successful. :) Jan 10, 2016 at 11:19
• @Merlin - I just copied the above code into a notebook and it evaluated just fine. Jan 10, 2016 at 16:48