Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm trying to use GraphicsColumn to plot two curves with very different ranges. for example,

GraphicsColumn[{Plot[Sin[x], {x, 0, 10}, PlotRange -> All, 
   AspectRatio -> 0.3, Frame -> True, Axes -> False, 
   ImageMargins -> 20], 
  Plot[Cos[x], {x, 0, 10}, PlotRange -> All, AspectRatio -> 0.3, 
   Frame -> True, Axes -> False, ImageMargins -> 20]}, 
 Epilog -> {Text["Frequency", {Center, Bottom}], 
   Rotate[Text["Power", {0.5, Center}], 90 Degree]}]

But the x label is not displayed properly, i.e., it is cut by the edge of the graph.

enter image description here

How to improve it?

share|improve this question
    
A related question is: Cropped pdf file after export –  Jens Jun 26 '12 at 5:35
add comment

2 Answers 2

up vote 7 down vote accepted

PlotRangePadding option can give you more space around your graphics objects.

GraphicsColumn[{Plot[Sin[x], {x, 0, 10}, PlotRange -> All, 
   AspectRatio -> 0.3, Frame -> True, Axes -> False, 
   ImageMargins -> 20], 
  Plot[Cos[x], {x, 0, 100}, PlotRange -> All, AspectRatio -> 0.3, 
   Frame -> True, Axes -> False, ImageMargins -> 20]}, Epilog -> 
  Style[{Text["Frequency", Scaled@{.5, .02}], 
    Rotate[Text["Power", Scaled@{.03, .5}], 90 Degree]}, 14, 
   FontFamily -> "Helvetica"], PlotRangePadding -> {0, 70}, 
 ImageSize -> 500]

enter image description here

share|improve this answer
    
Thank you. You've known so much about plot! –  yulinlinyu Jun 26 '12 at 4:08
    
@Mr.Wizard Just checked. Image corresponds to the code. M.8.0.4, win7. –  Vitaliy Kaurov Jun 26 '12 at 5:57
    
@Mr.Wizard Maybe something changed for absolute coordinate specs from v7 to v8. I changed code to scaled coordinates. Could you check if this helps? –  Vitaliy Kaurov Jun 26 '12 at 6:07
    
Confirmed to work. +1 –  Mr.Wizard Jun 26 '12 at 6:19
add comment

An alternative using Labeled:

Labeled[
 GraphicsColumn[{
   Plot[Sin[x], {x, 0, 10}, PlotRange -> All, AspectRatio -> 0.3,
    Frame -> True, Axes -> False, ImageMargins -> 0], 
   Plot[Cos[x], {x, 0, 100}, PlotRange -> All, AspectRatio -> 0.3, 
    Frame -> True, Axes -> False, ImageMargins -> 0]}, 
   Alignment -> Left], 
 {"Frequency", "Power"}, {Bottom, Left}, 
 RotateLabel -> True, 
 LabelStyle -> Directive[Bold, FontFamily -> "Helvetica"], 
 FrameMargins -> 0, ImageMargins -> 10]

enter image description here

share|improve this answer
    
I prefer this one! –  yulinlinyu Jun 26 '12 at 12:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.