# Shifting a curve upward

I am using Overlay to plot two curves in one graph while one of the curves is on a second vertical axis. How can I shift one of the curves (the dashed one here) upward to be above all other curves?

gamma4 = .4; gamma3 = .284; gamma2 = .265; gamma1 = .484; z3 = 10000;
z2 = 32000; z1 = 75000; zbar4 = 4800; zbar3 = 20050; zbar2 = 46200;
zbar1 = 138100; h4 = .301; h3 = .404; h2 = .25;
h1 = .045; p1 = 3.89; p2 = 4.92; p3 = 5.22;
p4 = 5.39; g1 = 0; g2 = 0.44; g3 = 0.88; g4 = 1.76;

Gain2 =
h2 (zbar2 - z2) + h1 (z1 - z2) +
(a (g1 p1 + (g2 p2/τ2) + g3 p3 + g4 p4) - 1) h2 zbar2 gamma2 (τ2/(1 - τ2));

d0 = Show[Plot[Evaluate @ Table[Gain2, {a, 0.05, 0.09, 0.01}], {τ2, 0, 1}]]

d2 =
Show[
Plot[Evaluate @ Table[Gain2, {a , 100, 100, 100}], {τ2, 0, 1},
Axes -> None, PlotStyle -> {Directive[Black, Dashed]}]]

d = Overlay[{d0, d2}]

• Why not just add an appropriate constant to the functions you want to shift? Sep 2, 2017 at 4:28
• Since it is on a second axis, adding constant didn't help. Sep 2, 2017 at 4:33
• Why can't you plot both in one Plot[]? Sep 2, 2017 at 4:33
• Because the second one (d2) is way larger that the first one (d0). Sep 2, 2017 at 4:35
• Then, why not rescale the last one? Trying it out, a scale factor of 1.*^-4 looks reasonable. Sep 2, 2017 at 4:58

Overlay is not the appropriate tool for what you a trying to do. Since the vertical ranges of the two plots are so disparate, I recommend simply stacking the two plots with GraphicsColumn.

gamma4 = .4; gamma3 = .284; gamma2 = .265; gamma1 = .484;
z3 = 10000; z2 = 32000; z1 = 75000;
zbar4 = 4800; zbar3 = 20050; zbar2 = 46200; zbar1 = 138100;
h4 = .301; h3 = .404; h2 = .25; h1 = .045;
p1 = 3.89; p2 = 4.92; p3 = 5.22; p4 = 5.39;
g1 = 0; g2 = 0.44; g3 = 0.88; g4 = 1.76

Gain2 =
h2 (zbar2 - z2) + h1 (z1 - z2) +
(a (g1 p1 + (g2 p2/τ2) + g3 p3 + g4 p4) - 1) h2 zbar2 gamma2 (τ2/(1 - τ2));

d0 =
Plot[Evaluate @ Table[Gain2, {a, 0.05, 0.09, 0.01}], {τ2, 0, 1},
PlotRange -> {Automatic, {0, Automatic}}]];
d2 =
Plot[Gain2 /. a -> 100, {τ2, 0, 1},
AxesOrigin -> {0, 6*^7},
PlotRange -> {Automatic, {2*^5, Automatic}},
PlotStyle -> Directive[Black, Dashed]]

GraphicsColumn[{d2, d0}]


Notes

• Show is not necessary.
• I adjust PlotRange and AxesOrigin so as to convince the viewer to see the stacked graphs as being in a single viewport although they are not.