貌似两个不可兼得,需要变通一下:用Axes画坐标,用Inset显示坐标轴标签。
g[w_](*电子电场漂移作图*):=
Module[{phy = w(*初相位*), \[Omega]t, tra, x, p1, p2, u, result},
trajectory[\[Omega]t_, \[Omega]t0_] := (x[\[Omega]t] /.
First@DSolve[{x''[\[Omega]t] == -Cos[\[Omega]t],
x'[\[Omega]t0] == 0, x[\[Omega]t0] == 0}, x, \[Omega]t]);
result = \[Omega]t /.
NSolve[{trajectory[\[Omega]t, phy] == 0, \[Pi]/2 <= \[Omega]t <
2 \[Pi]}, \[Omega]t][[1]];
u = Evaluate@2 (Sin[phy] - Sin[result])^2;
(*Print[u];*)tra = trajectory[\[Omega]t, phy];
result = \[Omega]t /. FindRoot[tra == 0, {\[Omega]t, #}] & /@
Range[0, 2 Pi];
p1 = Plot[-tra, {\[Omega]t, Min@result, Max@result},
PlotStyle -> Blend[{Red, Green, Blue}, RandomReal[]],
ImageSize -> 600, PlotRange -> All,
AxesStyle -> Directive[Arrowheads[0.05], Red],
Epilog -> {Inset[
Style["\[Omega]t", Red, FontSize -> 20], {Center, -0.2}],
Inset[Rotate[Style["x(a.u)", Red, FontSize -> 20],
90 Degree], {-0.4, Center}]},
LabelStyle -> Directive[Red, Bold, FontSize -> 20]
]
] // Quiet
Show[Table[g[i], {i, 0.1, Pi/2, 0.1}],
PlotRange -> {{-0.5, 5}, {-0.2, 2}}]