Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Aligning framed graphics in rows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Szabolcs Horvát  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 09:20
Newsgroups: comp.soft-sys.math.mathematica
From: Szabolcs Horvát <szhor...@gmail.com>
Date: Thu, 5 Nov 2009 09:20:02 +0000 (UTC)
Local: Thurs 5 Nov 2009 09:20
Subject: Aligning framed graphics in rows
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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Park  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:10
Newsgroups: comp.soft-sys.math.mathematica
From: "David Park" <djmp...@comcast.net>
Date: Fri, 6 Nov 2009 10:10:42 +0000 (UTC)
Local: Fri 6 Nov 2009 10:10
Subject: Re: Aligning framed graphics in rows
The two plots look different because of the different sizes of the material
outside of the frame. In this case it is the different widths of the
vertical tick labels.

The way to fix this is to explicitly specify the space allotted for the
outside-the-frame items using the ImagePadding option. Then it will be the
same for both plots. You must specify the ImagePadding to be large enough to
accommodate all the material in all of the plots.

GraphicsRow[{LogLogPlot[1 + Sin[x], {x, 1, 100}, Axes -> False,
   Frame -> True, FrameLabel -> {"horizontal", "vertical"},
   AspectRatio -> 4/5,
   ImagePadding -> {{50, 5}, {40, 5}}],
  Plot[Sinc[x], {x, -5, 5}, Axes -> False, Frame -> True,
   FrameLabel -> {"horizontal", "vertical"}, AspectRatio -> 4/5,
   ImagePadding -> {{50, 5}, {40, 5}}]},
 ImageSize -> 600]

David Park
djmp...@comcast.net
http://home.comcast.net/~djmpark/

From: Szabolcs Horv=E1t [mailto:szhor...@gmail.com]

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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark McClure  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:11
Newsgroups: comp.soft-sys.math.mathematica
From: Mark McClure <mcmcc...@unca.edu>
Date: Fri, 6 Nov 2009 10:11:09 +0000 (UTC)
Local: Fri 6 Nov 2009 10:11
Subject: Re: Aligning framed graphics in rows
2009/11/5 Szabolcs Horv=E1t <szhor...@gmail.com>:

> 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?

Just set an explicit value for ImagePadding.

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

Mark McClure


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Albert Retey  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:12
Newsgroups: comp.soft-sys.math.mathematica
From: Albert Retey <a...@gmx-topmail.de>
Date: Fri, 6 Nov 2009 10:12:55 +0000 (UTC)
Local: Fri 6 Nov 2009 10:12
Subject: Re: Aligning framed graphics in rows
Szabolcs Horv=E1t schrieb:

I think that the difference in frame dimensions is due to different
settings of ImagePadding. You can achieve what you want with setting
ImagePadding to the same value for all your plots:

padding = 20;
GraphicsRow[{LogLogPlot[1 + Sin[x], {x, 1, 100}, Axes -> False,
   Frame -> True, FrameLabel -> {"horizontal", "vertical"},
   AspectRatio -> 4/5, ImagePadding -> padding],
  Plot[Sinc[x], {x, -5, 5}, Axes -> False, Frame -> True,
   FrameLabel -> {"horizontal", "vertical"}, AspectRatio -> 4/5,
   ImagePadding -> padding]}]

It needs some iterations to find a value that works for all plots.
Unfortunatley finding the largest ImagePadding values with
AbsoluteOptions and use that automatically seems to not work since it
will return ImagePadding -> All which is not much help...

hth,

albert


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Szabolcs Horvát  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:15
Newsgroups: comp.soft-sys.math.mathematica
From: Szabolcs Horvát <szhor...@gmail.com>
Date: Fri, 6 Nov 2009 10:15:31 +0000 (UTC)
Local: Fri 6 Nov 2009 10:15
Subject: Re: Aligning framed graphics in rows
On 2009.11.05. 10:20, Szabolcs Horv=E1t wrote:

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).


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google