# Adding Tips to Axis Lines

I am trying to add arrows pointing on the axis lines for the following graph:

\documentclass{article}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{amsmath}

\begin{document}

\begin{figure}[ht]

\centering

\begin{tikzpicture}[scale=1.75,line width=1pt]
\begin{axis}[
color= gray,
xmin=-4.9,
xmax=4.9,
ymin=-1.9,
ymax=2.9,
axis equal image,
axis lines=middle,
font=\scriptsize,
xtick distance=1,
ytick distance=1,
xticklabels={},
yticklabels={},
legend pos=outer north east,
]

\addplot[red, smooth, domain=-4.9:4.9] {(8)/(4 + x^2)};
\addlegendentry{$f(x)$}

\addlegendentry{$f'(x)$}

\addplot[green, smooth, domain=-4.9:4.9]{-(((16)*((4 + x^2)^2))-((4 + x^2)*
(64*(x^2))))/((4+x^2)^4)};
\addlegendentry{$f''(x)$}

\end{axis}
\end{tikzpicture}

\caption{Plotting the curve when $r=1$.}
\label{fig:1}

\end{figure}

\end{document}


Here is the output of the code:

See how only the top and the right end of the axis lines have arrow pointers, and the bottom and the left do not? Is there a way so I could get some on all four ends?

Thanks!

every inner x axis line/.append style={stealth-stealth},
every inner y axis line/.append style={stealth-stealth},


at the end of your axis options, just after the legend pos=outer north east, and just before the ]

See section 4.9.9 of the current reference manual.

If you are happy with them both being the same, you could just set a single key (as pointed out in the comments):

inner axis line style={stealth-stealth}

• Slightly shorter would be inner axis line style={stealth-stealth}. – Torbjørn T. Oct 21 at 20:57
• Great response, a quick easy solution to my problem! Much appreciated! – Aiden Kenny Oct 22 at 1:49