# how to fix this cartesian plane with tikzpicture?

by ryuk   Last Updated November 09, 2018 00:23 AM - source

I would like to modify this Cartesian plane, by drawing the vertical line x = -2 and adding the 0 and the lines as in the figure, but I can not fix them. Could you kindly help me?

\documentclass[margin=20pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots} %%%%%

\usepackage{lxfonts}

\begin{document}
\begin{tikzpicture}[
dot/.style={
circle,fill,draw,minimum size=2mm,inner sep=0
}]

\begin{axis}[
axis equal image,
max space between ticks=20, % This is one way of getting a tick for every integer
ticklabel style={font=\scriptsize},
axis lines = middle,
xmin=-5.5, xmax=5.5, % The range over which the x axis is drawn
ymin=-4.5, ymax=6.0, % The range over which the y axis is drawn
domain=-6:5.5,         % The range over which the function is evaluated
grid=both,
xlabel=$x$, ylabel=$y$
]

\addplot [very thick, blue, smooth] {-(0)*x+1};

\coordinate [label=above right:$0$] t (0.0,0.0);
\draw [color=black,fill=black,fill opacity=1.0] (a) circle (0.15cm);

\coordinate [label=above right:$y=1$] at (-4.0,2.0);

\coordinate [label=above right:$x=-2$] at (-4.0,-3.0);

\end{axis}

\end{tikzpicture}

\end{document}

Tags :