As the title indicates, I want to change the current position of the legends in a combined plot. The Mathematica code I used is
dataRG00 = {{2.5, 15.15}, {2.75, 13.73}, {3, 12.64}, {3.25,
11.56}, {3.5, 10.68}, {3.75, 9.65}, {4, 9.31}, {4.25, 9.27}, {4.5,
8.88}, {4.75, 8.21}, {5, 8.0}};
dataRG11 = {{2.5, 2.07}, {2.75, 3.0}, {3, 3.84}, {3.25, 4.58}, {3.5,
5.56}, {3.75, 6.32}, {4, 6.73}, {4.25, 7.10}, {4.5, 7.06}, {4.75,
7.07}, {5, 7.29}};
dataRG21 = {{2.5, 20.56}, {2.75, 19.50}, {3, 18.51}, {3.25,
17.51}, {3.5, 16.52}, {3.75, 15.63}, {4, 14.75}, {4.25,
13.85}, {4.5, 13.00}, {4.75, 12.26}, {5, 11.6}};
dataRG32 = {{2.5, 5.24}, {2.75, 5.14}, {3, 5.00}, {3.25, 4.51}, {3.5,
4.25}, {3.75, 3.62}, {4, 2.56}, {4.25, 1.66}, {4.5, 1.42}, {4.75,
1.29}, {5, 1.25}};
dataRG43 = {{2.5, 10.31}, {2.75, 10.41}, {3, 10.56}, {3.25,
10.46}, {3.5, 10.25}, {3.75, 10.33}, {4, 10.67}, {4.25,
10.23}, {4.5, 9.21}, {4.75, 9.60}, {5, 10.5}};
dataRG85 = {{2.5, 4.62}, {2.75, 4.64}, {3, 4.72}, {3.25, 4.67}, {3.5,
4.46}, {3.75, 4.49}, {4, 4.37}, {4.25, 4.22}, {4.5, 4.25}, {4.75,
4.06}, {5, 3.8}};
dataRG99 = {{2.5, 1.05}, {2.75, 0.77}, {3, 0.66}, {3.25, 0.74}, {3.5,
0.86}, {3.75, 0.81}, {4, 0.90}, {4.25, 0.76}, {4.5, 0.90}, {4.75,
0.90}, {5, 1.08}};
dataCH = {{2.5, 41.0}, {2.75, 42.81}, {3, 44.05}, {3.25, 45.96}, {3.5,
47.42}, {3.75, 49.18}, {4, 50.68}, {4.25, 52.90}, {4.5,
55.27}, {4.75, 56.60}, {5, 56.48}};
col = {Darker[Green], Red, Blue, Yellow, Orange, Cyan, Magenta,
Darker[Gray]};
ley = {"Box", "1:1 linear", "2:1 boxlet", "3:2 boxlet", "4:3 boxlet",
"8:5 boxlet", "Other resonances", "Chaotic"};
plrange = {{2.4, 5.1}, {-2, 60}};
legendPlot[xl_List] :=
ListPlot[xl, Frame -> True,
PlotStyle -> Table[{Thickness[0.003], col[[i]]}, {i, 1, 8}],
Joined -> True, PlotMarkers -> {Automatic, 15},
FrameLabel -> {"α", "Percentage %"},
FrameStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"],
PlotRange -> plrange, Axes -> False, ImageSize -> 600,
Epilog ->
Inset[Grid[
MapIndexed[{Graphics[{col[[First[#2]]],
Inset[Style[{\[FilledCircle], \[FilledSquare], \
\[FilledDiamond], \[FilledUpTriangle], \[FilledDownTriangle], \
\[EmptyCircle], \[EmptySquare], \[EmptyDiamond]}[[First[#2]]], 15]],
Thickness[0.08], Line[{{0, 0}, {1, 0}}]},
AspectRatio -> 0.5, ImageSize -> 20],
Style[ley[[First[#2]]], Bold, FontSize -> 10,
FontFamily -> "Helvetica"]} &, xl]],
Offset[{-2, -2}, Scaled[{1, 1}]], {Right, Top}]]
P0 = legendPlot[{dataRG00, dataRG11, dataRG21, dataRG32, dataRG43,
dataRG85, dataRG99, dataCH}]
which produces the following plot
Obviously, the position of the legends is wrong since they overlap part of the plot. What I want, is to move the legends outside the frame of the plot and particularly at the right hand side of it and adjust it at the middle of the y range. I "played" a lot with Offset
and Scaled
but I without success.
Any ideas?
PlotLegend
? $\endgroup$