4
$\begingroup$

How it is possible to set spacing in GraphicsRow and GraphicsColumn equal zero?

GraphicsRow[{
  GraphicsColumn[
   {Graphics[{Red, Rectangle[]}, ImageSize -> 35], 
    Graphics[{Blue, Rectangle[]}, ImageSize -> 35]}, Spacings -> 0
 ],
 GraphicsColumn[
  {Graphics[{Green, Rectangle[]}, ImageSize -> 35], 
   Graphics[{Black, Rectangle[]}, ImageSize -> 35]}, Spacings -> 0
 ]}, Spacings -> 0
]

gives this

enter image description here

$\endgroup$
3
$\begingroup$

Use options1 for Graphics and options2 for GraphicsRow and forGraphicsColumn where

options1 = Sequence[ImageSize -> 35, ImagePadding -> 0, PlotRangePadding -> 0];
options2 = Sequence[Spacings -> 0, Method -> {"ShrinkWrap" -> True}];

GraphicsRow[{GraphicsColumn[{Graphics[{Red, Rectangle[]}, options1],
    Graphics[{Blue, Rectangle[]}, options1]}, options2],
  GraphicsColumn[{Graphics[{Green, Rectangle[]}, options1],
    Graphics[{Black, Rectangle[]}, options1]}, options2]}, options2]

Mathematica graphics

$\endgroup$
5
$\begingroup$

Use negative numbers for spacings:

GraphicsRow[{GraphicsColumn[{Graphics[{Red, Rectangle[]}, 
     ImageSize -> 35], 
    Graphics[{Blue, Rectangle[]}, ImageSize -> 35]}, Spacings -> -2], 
  GraphicsColumn[{Graphics[{Green, Rectangle[]}, ImageSize -> 35], 
    Graphics[{Black, Rectangle[]}, ImageSize -> 35]}, 
   Spacings -> -2]}, Spacings -> -18]

enter image description here

The numbers are relative to the default spacing, so positive is further apart and negative is closer together.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.