5

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?

kglr
  • 394,356
  • 18
  • 477
  • 896
yulinlinyu
  • 4,815
  • 2
  • 29
  • 36

2 Answers2

10

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

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
6

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

kglr
  • 394,356
  • 18
  • 477
  • 896