# Rescaling and Image Padding Issues with GraphicsRow

I am trying to get a row of plots (which include legends and labels) using GraphicsRow, with vertical heights of the plots equal. I manually set the size and image padding of these plots so that the plots take up the same vertical space

verticalSize = 250;
p1 = Plot[Evaluate@Table[Cos[n x], {n, 1, 4}], {x, 0, 2 Pi},
Frame -> True, RotateLabel -> False, PlotRange -> All,
PlotLegends ->
Placed [Map[StringReplace["n= x", "x" -> ToString[#, InputForm]] &,
Table[n, {n, 1, 4}]], {Scaled[{0, 1}], {-0.1, 1.01}}],
Epilog -> Inset[Text[Style["(a)", 16]],
ImageScaled[{0.9, 0.9}], Alignment -> Center],
ImageSize -> {Automatic, verticalSize},
ImagePadding -> {{Automatic, Automatic}, {35, 4}}]

p2 = Plot[Evaluate@Table[(1/(\[Sigma] Sqrt[
2 Pi])) Exp[-0.5 (x/\[Sigma])^2], {\[Sigma], 1, 4}], {x,-10, 10},Frame -> True,
FrameLabel ->
{"x", "\[LeftBracketingBar]\!$$\*SubscriptBox[\( [CapitalPsi]$$, \
$$0$$]\)(x; \[Sigma])\!$$\*SuperscriptBox[\(\[RightBracketingBar]$$, \
$$2$$]\)"},
RotateLabel -> False, PlotRange -> All,
PlotLegends ->
Placed [Map[
StringReplace["\[Sigma]= x", "x" -> ToString[#, InputForm]] &,
Table[n, {n, 1, 4}]], {Scaled[{0, 1}], {-0.1, 1.01}}],
Epilog ->
Inset[Text[Style["(b)", 16]], ImageScaled[{0.9, 0.9}],
Alignment -> Center], ImageSize -> {Automatic, verticalSize},
ImagePadding -> {{Automatic, Automatic}, {35, 4}}]


This produces plots

Ideally, I want to see these exact images at the size I see in the output cell side-by-side in one graphic. However, when I come to using Graphics Row, the output shows that the overall image size and the image padding have been altered

Shouldn't Row be enough for the job?

row = Row[{p1, p2}]


To export, simply type

Export["row.pdf",row]


You might want to move the labels in the second picture to RHS.

• Sorry, I should have said: I then want to export the figure to pdf for use in a LaTex document – oweydd Jul 18 '18 at 13:29
• Sure, it is straightforward. The output file should be a pdf with a vector graphic. – Gregory Rut Jul 18 '18 at 13:56
• Doing as you suggested gives this !Mathematica graphics . How can I export it and retain the Frame, ticks and relative positions of the plots? – oweydd Jul 19 '18 at 9:22
• Interesting. In my case, this is the procedure I use all the time when using pdfs. No idea why in your case it does not work with pdfs (i'm using linux and windows). – Gregory Rut Jul 19 '18 at 15:02
• I'm using Mac and version 11.1.1, so perhaps that's it? – oweydd Jul 20 '18 at 11:31