MathGroup Archive 2002

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

Search the Archive

Re: Bad Alignment of Y Axes


In a message dated 10/18/2002 6:29:00 AM, ulbrich at biochem.mpg.de writes:

>I have 2 or more separate Plots which have different y but the same x
>axes.
>Like:
>
>Plot[Sin[x],{x,0,10}];
>Plot[1000Sin[x],{x,0,10}];
>
>
>At the display and printout, the y axes are not aligned. Even using the
>PlotRegion and ImageSize Options doesn't help. The only way I found
>was to align it manually with the mouse.
>Is there a package that solves the problem?
>The problem is, I have many, many plots to align...
>I use Mathematica 4.0.2.0 on a Windows 2000 PC.
>

Pad each axis label with a string of blanks that makes both axes 
labels take up the same space.

showplot[plt_] := Show[plt,
    Ticks -> {Automatic,
        Prepend[(Ticks /. 
                AbsoluteOptions[plt])[[2]], 
          {0.001, StringJoin[Table[" ", {5}]]}]},
    DisplayFunction -> $DisplayFunction]

p1 = Plot[Sin[x], {x, 0, 10}, 
      DisplayFunction -> Identity];

p2 = Plot[1000Sin[x], {x, 0, 10}, 
      DisplayFunction -> Identity];

showplot[p1];

showplot[p2];


Bob Hanlon


  • Prev by Date: Re: Mathematica 4.2: Problem with online help.
  • Next by Date: Re: Checking the Results of NDSolve
  • Previous by thread: Re: Bad Alignment of Y Axes
  • Next by thread: RE: Bad Alignment of Y Axes