I have two function that I plot over the same domain. They have quite different ranges. I wanted to show them together in one in one plot which displayed both over their full range. I solved the problem by overlapping the two which is not seem elegant to me.
This plots a quite nice figure but is there a better way to do it?
Clear[c, L, Δν, R]
c = 299792458;
L = 3440*10^(-9);
Δν = c/(2L);
R = 0.9;
ReflectionCoefficient[ν_] = R (Exp[I 2 Pi ν /Δν ]-1)/(1-R^2 Exp[ν I 2Pi /(Δν)]);
Phase =
Plot[Abs[ReflectionCoefficient[ν*c/(2L)]], {ν, 0. 5 + 2L/c, 1.5 + 2L/c},
PlotRange -> {{0.5, 1.5}, {-0.1, 1.1}},
PlotStyle -> {Red, Thick},
LabelStyle -> Directive[Bold, 12, Black],
FrameLabel -> {{"Intensity", "Phase in °"}, {"Free Spectral Range", ""}},
ImagePadding -> True,
ImageSize -> 500,
Frame -> {True, True, True, True},
FrameStyle -> {Black, Red, Black, Transparent},
FrameTicks ->
{{All, {{0.025, "-150"}}}, {True, True}},
FrameStyle -> Directive[22]]
Intensity =
Plot[Arg[ReflectionCoefficient[ν * c/(2L)]]*360/(2Pi), {ν, 0.5 + 2L/c , 1.5 + 2L/c},
PlotRange->{{0.5,1.5},{-190,190}},
LabelStyle->Directive[Bold,12,Black],
FrameLabel->{{"Intensity","Phase in °"},{"Free Spectral Range",""}},
ImagePadding->True,
ImageSize->500,
Frame->{True, True, True, True},
FrameStyle -> {Black, Transparent, Transparent, Blue},
FrameTicks ->
{{{{0, "0.2"}, {160, "1.0"}}, {{0, "0"}, {90, "90"},{180, "180"}, {-90, "-90"}, {-180, "-180"}}},
{True,True}},
FrameStyle -> Directive[22],
PlotStyle -> {Thick ,Blue}]
PowerPlot = Overlay[{Intensity, Phase}, Alignment->Left]
Edit by User:
My goal is to simplify the workflow to combine the two plots for creating a plot with two vertical axes.
Do you have a better idea?
End result: