# Arrowheads on Axes and Function

I'm trying to put arrowheads on both my axes and my function to no avail.

I would like to have the arrows on the left and the bottom of my axes as well as at the end of my function (both sides).

This is my code:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=both,
axis lines=center,
domain=-2*pi:2*pi,
samples=200,
no marks,
xticklabels={-2$\pi$,-1.5$\pi$,...$\pi$,2$\pi$},
xtick={-6.2832,-4.7124,...,6.2832},
x post scale=1.5
]
\end{axis}
\end{tikzpicture}
\end{document}

• In all the math texts I have, axis arrowheads point in the positive direction only, not both directions, and functions do not have arrowheads. I've always believed that was intentional, that the purpose of an arrowhead was to indicate which way the axis was oriented. (Of course, that always seems to be up and to-the-right by convention.) – dedded Sep 21 '17 at 19:14
• I was really hoping that this was a convention I could overwrite and make the way I teach the content to HS Students. Sigh. – C. L. Butler Sep 21 '17 at 19:15
• I assume pgfplots gives that control. But I'm not sure what the meaning of arrowheads on axes would be if you put them on both ends. What are you trying to express? – dedded Sep 21 '17 at 19:19

In order to add the arrows to the both sides of your axes, you may add axis line style={latex-latex} option to your plot style.

Here is my solution for your problem:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=both,
axis lines=center,
domain=-2*pi:2*pi,
samples=200,
no marks,
axis line style={latex-latex},
xticklabels={-2$\pi$,-1.5$\pi$,...$\pi$,2$\pi$},
xtick={-6.2832,-4.7124,...,6.2832},
x post scale=1.5
]