Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Aligning ListPlots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77158] Re: [mg77111] Aligning ListPlots
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Tue, 5 Jun 2007 06:33:46 -0400 (EDT)
  • References: <200706040745.DAA06030@smc.vnet.net>

Jan Rychter wrote:

>I always thought it to be a big omission in Mathematica that there was
>no facility for easily aligning multiple plots in a grid or column. Now,
>with the arrival of Mathematica 6, we finally have GraphicsGrid,
>GraphicsColumn and GraphicsRow!
>
>But -- I find those are essentially useless. When I build a
>GraphicsColumn composed of multiple ListPlots, the vertical axes are NOT
>aligned. Instead, Mathematica chooses to align the text labels on the
>axes. Because of this, examples in the manual look just fine, because
>labels on all the graphs are of the same length. But if you have, say,
>two ListPlots, and one has labels in the range 1..5 and the other in the
>range 10,000..100,000, the vertical axes will not align and the whole
>column will look bad.
>
>Does anyone know of a solution to this?
>
>thanks,
>--J.
>  
>
Look up ImagePadding in the help:

?ImagePadding

ImagePadding is an option for graphics functions that specifies what \
absolute extra padding should be left for extended objects such as \
thick lines and annotations such as tick and axis labels.

Here are two examples:

padding = {{80, 10}, {30, 10}};

GraphicsGrid[{{Plot[x^2, {x, 0, 5}, ImagePadding -> padding]}, {Plot[
    100000 x^2, {x, 0, 5}, ImagePadding -> padding]}}]

GraphicsColumn[{Plot[x^2, {x, 0, 5}], Plot[100000 x^2, {x, 0, 5}]} /.
  Graphics[a_, b_List] :> Graphics[a, Append[b, ImagePadding -> padding]]]

Carl Woll
Wolfram Research


  • Prev by Date: Re: Developing Applications using Mathematica
  • Next by Date: Re: Two Version 6.0 Package Problems
  • Previous by thread: Aligning ListPlots
  • Next by thread: Re: Aligning ListPlots