Using Padding and Margins with Graphics object
I think adding another frame will do what you want. Like so:
Manipulate[
Framed[
Framed[
GraphicsGrid[
{{Graphics3D[Background -> Green, ImagePadding -> 20],
Graphics3D[Background -> Yellow, ImagePadding -> 0]}},
Background -> LightGray,
ImageSize -> {400, 200},
Frame -> True],
FrameStyle -> None,
Background -> Red,
FrameMargins -> {{a, a}, {b, b}}],
FrameStyle -> {Red, AbsoluteThickness[2]},
FrameMargins -> 30,
Background -> White],
{{a, 20}, 0, 20, 1, Appearance -> "Labeled"},
{{b, 20}, 0, 20, 1, Appearance -> "Labeled"}]
You can use Show
to modify the background of the Graphics
expression returned by GraphicsGrid
:
Manipulate[
Framed[
Show[
GraphicsGrid[
{{Graphics3D[Background -> Green, ImagePadding -> 20],
Graphics3D[Background -> Yellow, ImagePadding -> 0]}},
Background -> LightGray,
ImageSize -> {400, 200}, Frame -> True,
PlotRangePadding -> {a, b}
],
Background -> Red
],
FrameStyle -> Red, FrameMargins -> 30, Background -> White
],
{{a, 20}, 0, 20, 1, Appearance -> "Labeled"},
{{b, 20}, 0, 20, 1, Appearance -> "Labeled"}
]
This works because GraphicsGrid
returns a Graphics
expression with the contents placed as Inset
. The Background
specified in the options to GraphicsGrid
is implemented using Rectangle
directives, since it needs to be flexible enough to support coloring of individual grid cells, which also explains why the PlotRangePadding
is added "around" the background.