I want to export multiple plots and always have a small picture of another plot in the top right corner (as there is no data of the main plot in this region). However, it would be nice if I didn't have to set the position argument in Inset[] manually, as my y-values change for every plot. Thank you for any help! Below is an example of my code with the export part cut out off the For-loop. The issue is in the last line of the code, where I try to determine the position of the Inset-plot depending on the y-values, which is not working very well.
For[zz = 1, zz <= 4, zz++, LargeRangePlotLargeM = ListPlot[{ DeltaDeltaPPS2to5LargeM[[zz]], DeltaDeltaRS2to5LargeM[[zz]], DeltaDeltaPRS2to5LargeM[[zz]], DeltaDeltaGHZ2to5LargeM[[zz]]}, PlotMarkers -> "OpenMarkers", PlotRange -> All]; LargeRangePlotWithLargeM = ListPlot[{DeltaDeltaPPS2to5[[zz]], DeltaDeltaRS2to5[[zz]], DeltaDeltaPRS2to5[[zz]], DeltaDeltaGHZ2to5[[zz]]}, PlotLegends -> {"PPS", "RS", "PRS", "GHZ"}, AxesLabel -> {"M", "FSA"}, PlotLabel -> StringForm["N = ``", zz + 1], PlotMarkers -> "OpenMarkers", PlotRange -> All, Epilog -> Inset[LargeRangePlotLargeM, {750, 2 * DeltaDeltaGHZ2to5[[1]][[2]][[2]]}]]; ] Simpler code with the same question might look like this:
p2 = Plot[Sin[x], {x, 0, \[Pi]}]; pcombined = Plot[Sin[x], {x, 0, 2 \[Pi]}, Epilog -> Inset[p2, {5, 0.5}]] How do I now define the position argument inside Inset in a way that it moves the plot to the top right corner without having to choose plot specific values manually?




Plot[Sin[x], {x, 0, 2 \[Pi]}, Epilog -> Inset[p2, {Right, Top}, {Right, Top}], ImageSize -> Large]? $\endgroup$PlotRangeof the inset or adding somePadding. $\endgroup$