As the title indicates, I want to add inside the main plot (preferably at the lower left part) a zoom. Here is the corresponding Mathematica code:
Clear["Global`*"];
Off[General::spell];
Vd = -(Md/Sqrt[b^2 + R^2 + (a + Sqrt[h^2 + z^2])^2]);
Vn = -(Mn/Sqrt[R^2 + z^2 + cn^2]);
Vper = k*R^3 + λ*(R^2 + β*z^2)^2;
Vtot = Vd + Vn + Vper;
Veff = Vtot + Lz^2/(2*R^2);
Md = 12000; b = 8; a = 3; h = 0.1;
Mn = 400; cn = 0.25;
k = -0.35; λ = 0.01; β = 0.01;
Lz = 20;
E0 = -1100;
C0 = ContourPlot[Veff, {R, 0.001, 35}, {z, -80, 80}, Contours -> {E0},
PlotPoints -> 200, ContourShading -> False,
ContourStyle -> {Black, Thickness[0.003]},
PerformanceGoal -> "Quality", ImageSize -> 550];
SetDirectory[" ... "];
data = ReadList["orb_RR.out", Number, RecordLists -> True];
S0 = ListPlot[Flatten[List /@ data[[All, {2, 3}]], 1], Joined -> True,
PlotStyle -> Darker[Gray]];
P0 = Show[{C0, S0}, Frame -> True, FrameLabel -> {"R", "z"},
RotateLabel -> False, Axes -> False,
FrameStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"],
PlotRange -> {{0, 35}, {-80, 80}}, ImageSize -> 550]
P1 = Show[{C0, S0}, Frame -> True, FrameLabel -> {"R", "z"},
RotateLabel -> False, Axes -> False,
FrameStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"],
PlotRange -> {{0.3, 4.5}, {-5, 5}}, ImageSize -> 550]
The main plot which is produced by P0
is the following
Obviously, it is impossible to understand and interpret the orbit which is inside the closed curve. One may argue, that this issue could be easily solved by just changing the ranges of plot. However, this is not very wise approach, since I need to present the entire area defined by the closed curve and then point out that the orbit is indeed confined only at a very small sub-area. So, I have to incorporate the zoom plot created by P1
using the specified ranges preferably at the lower left side of the main plot (where there is plenty of available space). It would be very nice if there were also arrows pointing the original position of the zoom.
The file containing the orbit data can be downloaded from here:
Any ideas on how this could be done?
Many thanks in advance!