I want to plot a straight line perpendicular to the $x$-axis at $x=1$. None of the following attempts work:
Plot[EvenQ[x == 1], {x, -1, 2}]
Plot[x == 1, {x, -1, 2}]
Plot[1, {x, -1, 2}]
I have only managed to do it with ContourPlot
:
ContourPlot[Evaluate[x == 1], {x, -1, 2}, {y, -1, 2}, Axes -> True]
How can I use Plot
command to draw a straight line perpendicular to the x-axis?
Plot[x, {x, -1, 2}, GridLines -> {{1}, None}, GridLinesStyle -> Directive[Red, Dashed, Thick]]
? $\endgroup$ParametricPlot[{1, x}, {x, -1, 1}]
. $\endgroup$