示例:
Clear["`*"];
Plot[Sin[x], {x, 0, 2 Pi}, Epilog -> Line[{{4, -100}, {4, 100}}]]
结果图:
虚线表示平行于y轴的直线
Clear["`*"];
Plot[Sin[x], {x, 0, 2 Pi},
Epilog -> {Dashed, Line[{{4, -100}, {4, 100}}]}]
限制纵轴坐标范围
PlotRange
Clear["`*"];
Plot[Sin[x], {x, 0, 2 Pi},
Epilog -> {Dashed, Line[{{4, -100}, {4, 100}}]},
PlotRange -> {-2, 2}]