4
$\begingroup$

I have a GraphicsGrid with some pictures and I want to create some sort of a headline for each column like this:

pic = Import["ExampleData/ocelot.jpg"];
GraphicsGrid[{{"ocelot1", "ocelot2", "ocelot3"}, {pic, pic, 
   pic}, {pic, pic, pic}}]

However, the "row spacings" of the text cells are way too large and I want to somehow make them smaller such that it looks more like a headline (such that the text is right on top of the pic with narrow spacings).

Is there a way to do this, or alternatively, another/better/easier way to create some sort of headline for a column?

$\endgroup$
4
$\begingroup$

Grid has plenty of options

Grid[{{"ocelot1", "ocelot2", "ocelot3"}, {pic, pic, pic}, {pic, pic, pic}},
 Spacings -> {1, 1}]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks eldo! I tried to use the Spacings option with GraphicsGrid which did not work, but with Grid it works well it seems. Good to know! $\endgroup$ – holistic Jul 18 '17 at 20:38
  • 1
    $\begingroup$ Grid is much more flexible than GraphicsGrid $\endgroup$ – eldo Jul 18 '17 at 20:40
1
$\begingroup$

I would use Grid as in @eldo's answer. However, if you have to use GraphicsGrid you can use negative Spacings as follows:

GraphicsGrid[{{"ocelot1", "ocelot2", "ocelot3"}, {pic, pic, pic}, {pic, pic, pic}}, 
 Spacings -> {Automatic, {2 -> Scaled[-.5]}}]

enter image description here

| improve this answer | |
$\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.