MathGroup Archive 2009

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

Search the Archive

Re: Aligning framed graphics in rows

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104669] Re: Aligning framed graphics in rows
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 6 Nov 2009 05:17:40 -0500 (EST)
  • References: <hcu5c2$m2p$1@smc.vnet.net>

On 2009.11.05. 10:20, Szabolcs Horv=E1t wrote:
> Hello,
>
> Is there a reliable way to align framed graphics in a row, in such a way
> that both the top and bottom of the frame are at the same level?
>
> Here is an example:
>
> GraphicsRow[
>    {
>     LogLogPlot[1 + Sin[x], {x, 1, 100}, Axes ->  False, Frame ->  True,
>      FrameLabel ->  {"horizontal", "vertical"}, AspectRatio ->  4/5],
>     Plot[Sinc[x], {x, -5, 5}, Axes ->  False, Frame ->  True,
>      FrameLabel ->  {"horizontal", "vertical"}, AspectRatio ->  4/5]
>     }]
>
>
> Note how the second graphic is taller than the first one.  I would like
> the frames to be properly aligned, for aesthetic reasons.  All my
> graphics have (different) frame labels, and their aspect ratio is fixed.
>

I think I found a solution:

The key is the ImagePadding option.  The above example could be modified
like this:

GraphicsRow[
  Show[#, ImagePadding -> {{All, All}, {All, 5}}] & /@ {LogLogPlot[
     1 + Sin[x], {x, 1, 100}, Axes -> False, Frame -> True,
     FrameLabel -> {"horizontal", "vertical"}, AspectRatio -> 4/5],
    Plot[Sinc[x], {x, -5, 5}, Axes -> False, Frame -> True,
     FrameLabel -> {"horizontal", "vertical"}, AspectRatio -> 4/5]}]

Each graphic needs to have the same top and bottom ImagePadding.  The
automatically computed values at the bottom are the same in this
particular case.  The top value was set to 5 manually.  If I understand
it correctly, the value given to ImagePadding is to be understood in
printer's points (but it accepts Scaled[] values as well).


  • Prev by Date: Re: Aligning framed graphics in rows
  • Next by Date: Re: Aligning framed graphics in rows
  • Previous by thread: Re: Aligning framed graphics in rows
  • Next by thread: Re: Aligning framed graphics in rows