MathGroup Archive 2001

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

Search the Archive

Re: Aligning subplots nicely?

  • To: mathgroup at
  • Subject: [mg31716] Re: [mg31659] Aligning subplots nicely?
  • From: Omega Consulting <omega_consulting at>
  • Date: Wed, 28 Nov 2001 01:29:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at

At 04:46 AM 11/23/2001, Sampo Smolander wrote:
>Is there a handy way to aling subplots nicely?
>For example, if I have
>   {p1, p2} = {Plot[x^2, {x, 0, 1}], Plot[x^2, {x, 0, 0.1}]}
>and then I do
>   Show[GraphicsArray[{p1, p2}]]
>Then the two subplots are of different size (because in p2 the
>numbers in y-axis are longer, and take relatively more or
>the rectangle that GraphicsArray assignes to the subplot),
>and the result looks ugly.
>I found out that I can do this:
>Show[Graphics[{Rectangle[{0, 0}, {1, 1}, kk1],
>                Rectangle[{1, -0.02}, {2.18, 1.05}, kk2]}]];
>It looks relatively nice (at leat in certain size),
>but I need lots of iterative handwork to tune the
>rectangle parameters.
>Any better ways?
>Sampo Smolander, shsmolan at,
>............"the more bottles we use, the closer we ought to come"
>................ D.J. Griffiths: Introduction to Quantum Mechanics

One way is to use FullGraphics. This turns the Tick marks into Text 
primitives. When combined in a GraphicsArray, the Ticks in both graphs are 
treated equally. You usually have to massage the PlotRange (and sometimes 
the GraphicsSpacing) so that you can see the Ticks.

{p1b, p2b} = FullGraphics/@{p1,p2}

Show[GraphicsArray[{p1b, p2b}],

Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.

  • Prev by Date: Re: Loop through a notebook
  • Next by Date: Re: integral function
  • Previous by thread: RE: Aligning subplots nicely?
  • Next by thread: notebook2e.sty has conflicts with amsmath.sty...