# Disabling the arrows that appear in pgfplots on the axes

By default in PGFplots, when axes are only shown in the bottom left corner, arrows appear at the end of the ends of axes lines. How can I change the defaults so these arrows do not appear?

Edit: Example code that produces plots with arrows at the tips of the axes lines

\documentclass{article}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}[axis x line=middle,axis y line=middle]
\end{axis}
\end{tikzpicture}
\end{document}

-
Can you please add to your question a complete and minimal example code illustrating the behaviour mentioned? – Gonzalo Medina Jul 19 '12 at 22:16

You can use

\pgfplotsset{ every non boxed x axis/.append style={x axis line style=-},
every non boxed y axis/.append style={y axis line style=-}}


A complete MWE follows

\documentclass{article}
\usepackage{pgfplots}

\pgfplotsset{ every non boxed x axis/.append style={x axis line style=-},
every non boxed y axis/.append style={y axis line style=-}}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}

\end{document}

-
I don't see difference in the output with or without the \pgfplotsset. – Peter Grill Jul 20 '12 at 3:28
Your code won't produce the expected result. – Gonzalo Medina Jul 20 '12 at 6:25
I don't see a difference either, but I'm hoping the answer looks something like this. – Jeff Jul 20 '12 at 6:42
@Jake has a correction to your pgfplotsset command that makes it work for me. Could you correct your answer? – Jeff Jul 20 '12 at 7:28
@Jeff the moral of the story is: post a MWE :) I would have been able to fix the code myself if I had seen what you were working with – cmhughes Jul 20 '12 at 21:27

There are "starred" versions of the axis x line and axis lines keys that switch off the arrow tips.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}[axis lines*=middle]
\end{axis}
\end{tikzpicture}
\end{document}


-

You can use the axis line style option; an example showing the axis with and without the arrows:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[axis x line=middle,axis y line=middle]
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[axis x line=middle,axis y line=middle,axis line style={-}]
\end{axis}
\end{tikzpicture}

\end{document}


As Jake mentioned in a comment, to globally disable the arrow tips, you can use

\pgfplotsset{ every non boxed x axis/.append style={x axis line style=-} }

-
This example works great, but is there a way to make this the default 'axis line style' for every plot? I'm generating many figures using matlab2tikz and would like to set this globally in the TeX file if possible. – Jeff Jul 20 '12 at 6:37
@Jake That seemed to do the trick. Thanks. – Jeff Jul 20 '12 at 7:12
Although Gonzalo's answer works, I would prefer to see cmhughes answer corrected as that was more in the style of what I was looking for (although Gonzalo's is a perfectly valid answer). – Jeff Jul 20 '12 at 7:29