# Size and Alignment in GraphicsRow[....]

I just ran into a problem with GraphicsRow. Here an example (I want to combine a BarChart and a PairedBarChart), so...

{l1, l2} = RandomInteger[#, 20] & /@ {10, 10};


and:

g1 = BarChart[l1, BarOrigin -> Left]


and

g2 = PairedBarChart[l1, l2,
ChartLabels -> Range[20],
AxesLabel -> {"Horizontal", "Vertical"}
]


Then GraphicsRow delivers:

GraphicsRow[{g1, g2}]


Output (look at the borders of GraphicsRow):

Now the graphs are not aligned, so I used an alignment (Bottom in GraphicsRow), and got:

GraphicsRow[{g1, g2}, Alignment -> Bottom]


O.K. the graphs are aligned, but why this large surrounding box?

Update...

If I add a frame, everything is fine???

If you use AspectRatio->Full then it works without having to use Frame nor Alignment

{l1,l2} = RandomInteger[#,20]&/@{10,10};
g1      = BarChart[l1,BarOrigin->Left,AspectRatio->Full]
g2      = PairedBarChart[l1,l2,ChartLabels->Range[20],
AxesLabel->{"Horizontal","Vertical"},AspectRatio->Full]


Now

GraphicsRow[{g1,g2},ImageSize->700]


fyi, I noticed with this method, if the final imagesize is small, the numerical values in the right images in the middle there (the ones from 1..20, become harder to read as they do not scale.

• This works fine for me -so accepted as answer. But if you use Alignment->Bottom your get again the large surrounding box. What I also wonder about is that the alignment regards to the numbers at the tick-marks not the horizontal axes Dec 10, 2017 at 13:23

I usually use Grid. If you dont need frame just remove Frame@ in the code.

   SeedRandom[123];
{l1, l2} = RandomInteger[10, {2, 20}];

g1 = BarChart[l1, BarOrigin -> Left, ImageSize -> 350];

g2 = PairedBarChart[l1, l2, ChartLabels -> Range[20],
AxesLabel -> {"Horizontal", "Vertical"}, ImageSize -> 450];

Framed@Grid[{{g1, Spacer[2], g2}}, Alignment -> Bottom]