Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Extra spacing in GraphicsGrid

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83496] Re: Extra spacing in GraphicsGrid
  • From: m.r at inbox.ru
  • Date: Wed, 21 Nov 2007 03:05:09 -0500 (EST)
  • References: <fhu82c$7h6$1@smc.vnet.net>

On Nov 20, 3:06 am, Yaroslav Bulatov <yarosla... at gmail.com> wrote:
> In the code below, I'm trying to position two Graphics next to each
> other. However, I get excessive spacing between two graphics object
> even if I set Spacing to {0,0}. The problem goes away if I Rasterize
> the Graphics objects. However that is suboptimal because I need to
> keep the original graphics structure.
>
> So, is there any way to get rid of the extra spacing without
> rasterizing the graphics objects first?
>
> g = {1 -> 4, 2 -> 5, 3 -> 6, 4 -> 5, 5 -> 6, 6 -> 4};
> coloredPlot[g_, chosen_] :=
>   Module[{},
>    GraphPlot[g,
>     VertexRenderingFunction ->
>      Function[{r, v}, {If[MemberQ[chosen, v], Black, Red],
>        Disk[r, .2]}], EdgeLabeling -> None]];
> g1 = coloredPlot[g, {1}~Join~#] & /@ Subsets[Range[2, 6]] //
>     Partition[#, 4] & // GraphicsGrid;
> g2 = coloredPlot[g, #] & /@ Subsets[Range[2, 6]] //
>     Partition[#, 4] & // GraphicsGrid;
> GraphicsGrid[{{g1, g2}}, Spacings -> {0, 0}]
> GraphicsGrid[{{Rasterize[g1], Rasterize[g2]}}, Spacings -> {30, 0}]

When you put one GraphicsGrid inside another, the outer GraphicsGrid
cannot figure out the optimal inset sizes. Use

GraphicsGrid[{{g1, g2}}, ItemAspectRatio -> 2, Spacings -> 0]

Maxim Rytin
m.r at inbox.ru


  • Prev by Date: Re: Using FindRoot
  • Next by Date: Re: Variable-length list?
  • Previous by thread: Re: Extra spacing in GraphicsGrid
  • Next by thread: Re: Extra spacing in GraphicsGrid