# Plot placement in GraphicsRow

I use the code below to produce a 3D plot next to a 2D plot, but cannot place the plots nicely. The output plot has a lot of empty space to the left of the 3D plot and very little empty space to the right. I played around with Spacings. In this way I could move the plots a bit closer together and the right plot further away from the right boundary of the image, but I cannot move the 3D plot more towards the left boundary of the image. How can I achieve a more equidistant arrangement (the output image should have a 4:3 aspect ratio)?

sur[p_List] := {p[], p[], p[]^2 - p[]^2};
surface = ParametricPlot3D[sur[{x, y}], {x, -1, 1}, {y, -1, 1},PlotRange -> {{-0.7, 0.7}, {-0.7, 0.7}, {-1.5, 1.5}}];
GraphicsRow[{Show[surface, Boxed -> False, ImageSize -> 500],Show[Plot[2*Sin[2*angle], {angle, 0, Pi}, AspectRatio -> (4/5),PlotRange -> {{-0.1, Pi + 0.1}, {-2.5, 2.5}}]]}] • Try placing the graphs inside a Graphics[ ] statement, where you can size them at will. The commands that place graphics automatically, like the GraphicsRow you use here, do not allow as much customization. Jan 29, 2021 at 22:44
• @NicholasG You mean replacing GraphicsRow with Graphics? If I do that nothing is plotted anymore. Jan 30, 2021 at 8:19

You can reduce the space between elements in a GraphicsRow using the option Spacings. In the present case, you could even use negative spacings, such as

sur[p_List] := {p[], p[], p[]^2 - p[]^2};
surface =
ParametricPlot3D[sur[{x, y}], {x, -1, 1}, {y, -1, 1},
PlotRange -> {{-0.7, 0.7}, {-0.7, 0.7}, {-1.5, 1.5}}];

GraphicsRow[{
Show[surface, Boxed -> False, ImageSize -> 500],
Show[Plot[2*Sin[2*angle], {angle, 0, Pi}, AspectRatio -> (4/5),
PlotRange -> {{-0.1, Pi + 0.1}, {-2.5, 2.5}}]]},
Spacings -> -100]


Spacings is not the most conventient solution as AspectRatios are sometimes altered. Alternatively, you could use Inset, as in

Graphics[{
Inset[surface, {-10, 0}],
Inset[Show[
Plot[2*Sin[2*angle], {angle, 0, Pi}, AspectRatio -> (4/5),
PlotRange -> {{-0.1, Pi + 0.1}, {-2.5, 2.5}}]], {10, 0}]
}]


The coordinate to Inset specifies where you want the sub-graph be placed. That should give you more flexibility.

• Thanks! But all this seems to do is move the right plot more towards the center but the left remains where it is. I want to move the left plot more to the left as well. Jan 30, 2021 at 8:15
• @220284 I added a second solution with may offer what you are looking for. Jan 30, 2021 at 15:26
• Many thanks! I wasn't aware of inset. Jan 30, 2021 at 23:20

You can use Inset inside Graphics for precise placement, such as Graphics[{White, Rectangle[{0, 0}, {7, 5}], Inset[surface, Scaled[{.25, .5}], {.4, .5}, 5], Inset[linegraph, Scaled[{.65, .5}], {.5, 0}, 3]},(*Axes->False,*)AspectRatio -> 1/GoldenRatio] (You might need to un-rem the Axes to place them as you like), which produces this: • Many thanks for your help! Jan 30, 2021 at 23:21