2

The graph my code (below) is trying to reproduce is \frac{2}{\pi}\arctan{x} but all it creates is a line that shoots up into the y-axis. What is wrong with my graph and how do I fix it?

\begin{figure}[H]
    \centering
        \begin{tikzpicture}
        \begin{axis}[grid=both,
                  xmin = -.5, xmax = 10, ymin = 0, ymax = 2,
                  axis lines=middle,
                  enlargelimits]
        \addplot[black] (11,0) node[above left] {$x$};
        \addplot[black] (0,2.2) node[below right] {$\dfrac{\mathrm{d}x}{\mathrm{d}t}$};
        \addplot[red,dash pattern=on 8pt off 8pt, domain=-15:15]  {1} node[above left]{$y=1$};
        \addplot[blue,samples=1000,domain=0:15]  {atan(x)*((2))/(pi))};
        \end{axis}
        \end{tikzpicture}
        \caption{The graph of $\dfrac{\mathrm{d}x}{\mathrm{d}t} = \frac{2}{\pi}\arctan{x}$}
        \label{fig:logistic6}
    \end{figure}

0 Answers0