# How do I plot the graph of arctan using Tikz, NOT using pgfplots

by user185895   Last Updated April 16, 2019 01:23 AM

I am trying to plot the atan() function, but it keeps giving me an error. This is my code. What in the world am I doing wrong? Why doesn't it plot on the graph I made. Also I cannot use pgfplots.

\begin{tikzpicture}
\draw [help lines] (-5,-pi) grid (5,pi);
\draw [->,thick] (-5,0) -- (0,0) -- (5,0) node [below] {\small $x$};
\draw [->,thick] (0,-pi) -- (0,pi) node [left] {\small $y$};
\foreach \x in {-5,-4,...,5} \draw (\x, -0.1) -- (\x,0.1);
\foreach \x in {-5,-4,...,-1} \node at (\x, -0.1) [below] {\tiny $\x$};
\foreach \x in {1,2,...,5} \node at (\x, -0.1) [below] {\tiny $\x$};

\draw (-0.1, -pi/2) -- (0.1,-pi/2);
\draw (-0.1, -pi/4) -- (0.1,-pi/4);
\draw (-0.1, pi/4) -- (0.1,pi/4);
\draw (-0.1, pi/2) -- (0.1,pi/2);

\node at (-0.1, -pi/2) [left] {\tiny $-\pi/2$};
\node at (-0.1, -pi/4) [left] {\tiny $-\pi/4$};
\node at (-0.1, pi/4) [left] {\tiny $\pi/4$};
\node at (-0.1, pi/2) [left] {\tiny $\pi/2$};

\draw [scale=0.5,domain=0:5,variable=\x] plot (\x,atan(\x r));

\end{tikzpicture}

Tags :

## Related Questions

Updated April 27, 2019 15:23 PM

Updated December 20, 2018 03:23 AM

Updated November 20, 2018 12:23 PM

Updated December 17, 2018 22:23 PM

Updated December 18, 2018 02:23 AM